Try to teach sparse about construct like 'struct __attribute__((foo)) bar'
On the current linux git tree, sparse spit a lot of errors:
include/asm/lppaca.h:34:8: error: Trying to use reserved word '__attribute__' as identifier
which is caused by a declaration:
struct __attribute__((__aligned__(0x400))) lppaca {The following patch seems to solve the symptom but I'm not sure that the ctype is not handled correctly.
Also, now sparse produce a lot of others errors, mainly about address space mismatch like:
init/do_mounts.c:69:16: warning: incorrect type in argument 1 (different address spaces)
init/do_mounts.c:69:16: expected char const [noderef] *filename<asn:1>
init/do_mounts.c:69:16: got char *<noident>
What is strange is that these warning seems to be about a real address space problem but why sparse didn't warn before?
(IIRC, the warnings in init/do_mounts.c were reported by sparse some time ago).
---
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)
@@ -112,6 +113,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 5 lines · Luc Van Oostenryck
On the current linux git tree, sparse spit a lot of errors:
include/asm/lppaca.h:34:8: error: Trying to use reserved word '__attribute__' as identifierwhich is caused by a declaration:
struct __attribute__((__aligned__(0x400))) lppaca {
Funny, I just posted a patch to lkml regarding this. It'll be in the next -mm patch.
<b