Fix handling of ident-less declarations
commit65f354637410d2c5d33a6ca425a67ceacdd7cea0
authorAl Viro <viro@ftp.linux.org.uk>
Sat, 14 Feb 2009 12:25:05 +0000 (14 12:25 +0000)
committerChristopher Li <sparse@chrisli.org>
Fri, 17 Jul 2009 23:06:22 +0000 (17 23:06 +0000)
tree6be3b4c899174015b99664f18d1637471ee01f2f
parent801c6d64cae47d0c7ffc55c53a0f3c599bc0dcaf
Fix handling of ident-less declarations

The rule for ident-less declaration is
declaration -> declaration-specifiers ;
not
declaration -> declaration-specifiers abstract-declarator;

IOW, struct foo; is OK and so's struct foo {int x; int y;} (and even
simply int; is allowed by syntax - it's rejected by constraints, but
that's a separate story), but not struct foo (void); and its ilk.

See C99 6.7p1 for syntax; C90 is the same in that area and gcc also
behaves the same way.  Unlike gcc I've made it a warning (gcc produces
a hard error for those).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
parse.c
validation/missing-ident.c [new file with mode: 0644]