From 556079643d3f75d5a8ae39e7e748ab753bf1c2ca Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Sun, 14 Jun 2020 18:47:22 +0300 Subject: 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 --- parse.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit 1.2.3-korg