aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-06-14 18:47:22 +0300
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-06-14 22:32:25 +0200
commit556079643d3f75d5a8ae39e7e748ab753bf1c2ca (patch)
treee2f35cd517fc3a38a69df42f5d83969aeb0dd21f
parentb8e2004068f955b3999032fc37b2e5febecd7f8a (diff)
downloadsparse-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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index 570b2516..70d8b237 100644
--- a/parse.c
+++ b/parse.c
@@ -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);