Remove @(static) for global variables

This commit is contained in:
gingerBill
2021-05-19 11:51:48 +01:00
parent b34e4a9fd1
commit 26ce40c188
5 changed files with 6 additions and 17 deletions

View File

@@ -899,10 +899,9 @@ void check_global_variable_decl(CheckerContext *ctx, Entity *&e, Ast *type_expr,
e->Variable.thread_local_model = ac.thread_local_model;
e->Variable.is_export = ac.is_export;
e->flags &= ~EntityFlag_Static;
if (ac.is_static) {
e->flags |= EntityFlag_Static;
} else {
e->flags &= ~EntityFlag_Static;
error(e->token, "@(static) is not supported for global variables, nor required");
}
ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix);