* [PATCH] attribute: parse but ignore enum attributes
@ 2020-06-14 16:02 Luc Van Oostenryck
2020-06-14 19:35 ` Ramsay Jones
0 siblings, 1 reply; 2+ messages in thread
From: Luc Van Oostenryck @ 2020-06-14 16:02 UTC (permalink / raw)
To: linux-sparse; +Cc: Luc Van Oostenryck
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] attribute: parse but ignore enum attributes
2020-06-14 16:02 [PATCH] attribute: parse but ignore enum attributes Luc Van Oostenryck
@ 2020-06-14 19:35 ` Ramsay Jones
0 siblings, 0 replies; 2+ messages in thread
From: Ramsay Jones @ 2020-06-14 19:35 UTC (permalink / raw)
To: Luc Van Oostenryck, linux-sparse
On 14/06/2020 17:02, Luc Van Oostenryck wrote:
> Currently, sparse is confused whne encountering an enum attribute.
s/whne/when/
ATB,
Ramsay Jones
>
> 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);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-14 19:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-14 16:02 [PATCH] attribute: parse but ignore enum attributes Luc Van Oostenryck
2020-06-14 19:35 ` Ramsay Jones
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).