From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH] attribute: parse but ignore enum attributes
Date: Sun, 14 Jun 2020 18:02:35 +0200 [thread overview]
Message-ID: <20200614160235.22320-1-luc.vanoostenryck@gmail.com> (raw)
Currently, sparse is confused whne encountering an enum attribute.
Teach sparse about these attributes and, for now, ignore them.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
parse.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/parse.c b/parse.c
index 570b2516714f..70d8b237ce5e 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);
--
2.27.0
next reply other threads:[~2020-06-14 16:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 16:02 Luc Van Oostenryck [this message]
2020-06-14 19:35 ` [PATCH] attribute: parse but ignore enum attributes Ramsay Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200614160235.22320-1-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).