diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-06-14 18:47:22 +0300 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-06-14 22:32:25 +0200 |
commit | 556079643d3f75d5a8ae39e7e748ab753bf1c2ca (patch) | |
tree | e2f35cd517fc3a38a69df42f5d83969aeb0dd21f | |
parent | b8e2004068f955b3999032fc37b2e5febecd7f8a (diff) | |
download | sparse-556079643d3f75d5a8ae39e7e748ab753bf1c2ca.tar.gz |
attribute: parse but ignore enum attributes
Currently, sparse is confused when encountering an enum attribute.
Teach sparse about these attributes and, for now, ignore them.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -937,8 +937,12 @@ static struct token *parse_enum_declaration(struct token *token, struct symbol * while (token_type(token) == TOKEN_IDENT) { struct expression *expr = NULL; struct token *next = token->next; + struct decl_state ctx = { }; struct symbol *sym; + // FIXME: only 'deprecated' should be accepted + next = handle_attributes(next, &ctx, KW_ATTRIBUTE); + if (match_op(next, '=')) { next = constant_expression(next->next, &expr); lastval = get_expression_value(expr); |