linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: Daniel Drake <ddrake@brontes3d.com>
Cc: linux-sparse@vger.kernel.org, Josh Triplett <josh@freedesktop.org>
Subject: [PATCH] Re: __attribute__ annotations and struct types
Date: Wed, 14 Feb 2007 12:15:49 -0800	[thread overview]
Message-ID: <20070214201549.GB18753@chrisli.org> (raw)
In-Reply-To: <1171483314.14504.9.camel@systems03.mmm.com>

On Wed, Feb 14, 2007 at 03:01:54PM -0500, Daniel Drake wrote:
> sparse doesn't like it:
> 
> 	test.c:7:8: error: Trying to use reserved word '__attribute__' 
> 	as identifier

Can you please try this:

Chris

Handle structure attribute.

struct __attribute__((__aligned__(16))) foo {
    int a;
};

Signed-Off-By: Christopher Li <sparse@chrisli.org>

Index: sparse/parse.c
===================================================================
--- sparse.orig/parse.c	2007-02-14 12:37:17.000000000 -0800
+++ sparse/parse.c	2007-02-14 12:40:48.000000000 -0800
@@ -34,6 +34,7 @@ struct symbol_list *function_computed_ta
 struct statement_list *function_computed_goto_list;
 
 static struct token *statement(struct token *token, struct statement **tree);
+static struct token *handle_attributes(struct token *token, struct ctype *ctype);
 
 // Add a symbol to the list of function-local symbols
 static void fn_local_symbol(struct symbol *sym)
@@ -156,6 +157,7 @@ static struct token *struct_union_enum_s
 	struct position *repos;
 
 	ctype->modifiers = 0;
+	token = handle_attributes(token, ctype);
 	if (token_type(token) == TOKEN_IDENT) {
 		sym = lookup_symbol(token->ident, NS_STRUCT);
 		if (!sym ||

  reply	other threads:[~2007-02-14 20:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-14 20:01 __attribute__ annotations and struct types Daniel Drake
2007-02-14 20:15 ` Christopher Li [this message]
2007-02-14 21:02   ` [PATCH] " Daniel Drake
2007-02-14 21:05     ` Randy Dunlap
2007-02-23  2:23     ` Josh Triplett

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=20070214201549.GB18753@chrisli.org \
    --to=sparse@chrisli.org \
    --cc=ddrake@brontes3d.com \
    --cc=josh@freedesktop.org \
    --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).