https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37874

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid

--- Comment #6 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #5)
> (In reply to Chris Lattner from comment #0)
> > GCC rejects the former, but not the later.
> > 
> > void f2(y, __attribute__(()) x);
> > void f3(__attribute__(()) x, y);
> 
> GCC can be made to reject f3() with -Werror:
> 
> $ /usr/local/bin/gcc -c -Wall -Wextra -pedantic -Werror 37874.c
> 37874.c:1:12: error: expected ‘)’ before ‘__attribute__’
>  void f2(y, __attribute__(()) x);
>             ^~~~~~~~~~~~~
> 37874.c:2:1: error: parameter names (without types) in function declaration
> [-Werror]
>  void f3(__attribute__(()) x, y);
>  ^~~~
> cc1: all warnings being treated as errors
> 
> I see you fixed this for f4() at least for clang:
> 
> $ /sw/opt/llvm-3.1/bin/clang-3.1 -c 37874.c
> 37874.c:1:12: error: expected identifier
> void f2(y, __attribute__(()) x);
>            ^
> 37874.c:2:27: warning: type specifier missing, defaults to 'int'
> [-Wimplicit-int]
> void f3(__attribute__(()) x, y);
>         ~~~~~~~~~~~~~     ^
> 37874.c:2:30: warning: type specifier missing, defaults to 'int'
> [-Wimplicit-int]
> void f3(__attribute__(()) x, y);
>                              ^
> 37874.c:3:9: error: expected parameter declarator
> void f4(__attribute__(()));
>         ^
> 2 warnings and 2 errors generated.

Since clang rejects this, I'm making this an accepts-invalid

Reply via email to