Fix misleading error messages for init, fini and test attributes

These look like copy-pasta from the private attribute.
This commit is contained in:
Krzesimir Nowak
2025-12-21 18:59:21 +01:00
parent cb2f3aca8b
commit 8ca7fc481f

View File

@@ -3581,7 +3581,7 @@ gb_internal DECL_ATTRIBUTE_PROC(proc_decl_attribute) {
return true;
} else if (name == "test") {
if (value != nullptr) {
error(value, "'%.*s' expects no parameter, or a string literal containing \"file\" or \"package\"", LIT(name));
error(value, "Expected no value for '%.*s'", LIT(name));
}
ac->test = true;
return true;
@@ -3629,13 +3629,13 @@ gb_internal DECL_ATTRIBUTE_PROC(proc_decl_attribute) {
return true;
} else if (name == "init") {
if (value != nullptr) {
error(value, "'%.*s' expects no parameter, or a string literal containing \"file\" or \"package\"", LIT(name));
error(value, "Expected no value for '%.*s'", LIT(name));
}
ac->init = true;
return true;
} else if (name == "fini") {
if (value != nullptr) {
error(value, "'%.*s' expects no parameter, or a string literal containing \"file\" or \"package\"", LIT(name));
error(value, "Expected no value for '%.*s'", LIT(name));
}
ac->fini = true;
return true;