__attribute__ annotations and struct types
gcc-4.1.1 accepts this as valid code:
struct __attribute__((__aligned__(16))) foo {
int a;
};sparse doesn't like it:
test.c:7:8: error: Trying to use reserved word '__attribute__' as identifier
I'm not sure if this is a bug that people are interested in solving, as the more common form works in both gcc and sparse:
struct foo {
int a;
} __attribute__((__aligned__(16)));Thanks,
Signature · 2 lines
Daniel Drake Brontes Technologies, A 3M Company
Christopher Li
maintainerQuoted 4 lines · Daniel Drake
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;
};parse.c +2 -0
@@ -34,6 +34,7 @@ struct symbol_list *function_computed_tastruct 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_sstruct 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 ||
Quoted 11 lines · Christopher Li
Quoted 4 lines · Daniel Drake
sparse doesn't like it:
test.c:7:8: error: Trying to use reserved word '
__attribute__' as identifierCan you please try this:
Chris
Handle structure attribute.
Thanks for the quick response, works nicely!
Signature · 2 lines
Daniel Drake Brontes Technologies, A 3M Company
Quoted 7 lines · On Wed, 14 Feb 2007 16:02:07 -0500 Daniel Drake wrote:
Quoted 6 lines · Christopher Li
Quoted 4 lines · Daniel Drake
sparse doesn't like it:
test.c:7:8: error: Trying to use reserved word '
__attribute__' as identifier
Quoted 7 lines
Quoted 5 lines
Can you please try this:
Chris
Handle structure attribute.
Thanks for the quick response, works nicely!
so now drivers/kvm/* should be less nasty ;)
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 6 lines · Daniel Drake
Quoted 5 lines · Christopher Li
Quoted 4 lines · Daniel Drake
sparse doesn't like it:
test.c:7:8: error: Trying to use reserved word '
__attribute__' as identifier
Quoted 7 lines
Quoted 5 lines
Can you please try this:
Chris
Handle structure attribute.
Thanks for the quick response, works nicely!
Applied, along with a test case.
- Josh Triplett