Add -custom-attribute

This commit is contained in:
gingerBill
2024-06-28 11:44:05 +01:00
parent 1747fdc3f0
commit 17efb87eef
3 changed files with 41 additions and 2 deletions

View File

@@ -3900,10 +3900,11 @@ gb_internal void check_decl_attributes(CheckerContext *c, Array<Ast *> const &at
}
if (!proc(c, elem, name, value, ac)) {
if (!build_context.ignore_unknown_attributes) {
if (!build_context.ignore_unknown_attributes &&
!string_set_exists(&build_context.custom_attributes, name)) {
ERROR_BLOCK();
error(elem, "Unknown attribute element name '%.*s'", LIT(name));
error_line("\tDid you forget to use build flag '-ignore-unknown-attributes'?\n");
error_line("\tDid you forget to use the build flag '-ignore-unknown-attributes' or '-custom-attribute:%.*s'?\n", LIT(name));
}
}
}