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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #5 from Eric Gallager <egallager at gcc dot gnu.org> ---
(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.

Reply via email to