diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2009-02-14 12:25:55 +0000 |
---|---|---|
committer | Christopher Li <sparse@chrisli.org> | 2009-07-17 23:06:23 +0000 |
commit | ef5501aa2a87a5f02b426ff4150048c46048d829 (patch) | |
tree | 6cb7ec69d7b4ad0c916fdd6108a6ca3c322f0ba3 /parse.c | |
parent | more direct_declarator() sanitizing (diff) | |
download | sparse-ef5501aa2a87a5f02b426ff4150048c46048d829.tar.gz sparse-ef5501aa2a87a5f02b426ff4150048c46048d829.tar.bz2 sparse-ef5501aa2a87a5f02b426ff4150048c46048d829.zip |
Warn about non-empty identifier list outside of definition
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1196,8 +1196,16 @@ static enum kind which_kind(struct token *token, struct token **p, if (token_type(next) == TOKEN_IDENT) { if (lookup_type(next)) return (dont_nest || prefer_abstract) ? Proto : Nested; - if (dont_nest) - return (next == token->next) ? K_R : Bad_Func; + if (dont_nest) { + /* attributes in the K&R identifier list */ + if (next != token->next) + return Bad_Func; + /* identifier list not in definition; complain */ + if (prefer_abstract) + warning(token->pos, + "identifier list not in definition"); + return K_R; + } return Nested; } |