[Bug c/88237] __extension__ in function declaration argument list causes error

2018-11-28 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88237

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #4 from Eric Gallager  ---
(In reply to Andreas Schwab from comment #3)
> __extension__ can also be used for declarations and definitions that contain
> extensions, but it needs to occur at the start of them.

It'd be nice if the error message said this and offered a fix-it hint, instead
of printing the confusing "expected" wording.

[Bug c/88237] __extension__ in function declaration argument list causes error

2018-11-28 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88237

--- Comment #3 from Andreas Schwab  ---
__extension__ can also be used for declarations and definitions that contain
extensions, but it needs to occur at the start of them.  See the glibc sources
for examples.

[Bug c/88237] __extension__ in function declaration argument list causes error

2018-11-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88237

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Richard Biener  ---
@findex __extension__
@opindex pedantic
@option{-pedantic} and other options cause warnings for many GNU C extensions.
You can
prevent such warnings within one expression by writing
@code{__extension__} before the expression.  @code{__extension__} has no
effect aside from this.


But int a is not an expression.

[Bug c/88237] __extension__ in function declaration argument list causes error

2018-11-28 Thread jozef.l at mittosystems dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88237

--- Comment #1 from Jozef Lawrynowicz  ---
For C++ the errors are:

> g++ -S tester.c
> 
> tester.c:11:10: error: variable or field 'foo' declared void
>11 | void foo (__extension__ int a);
>   |  ^
> tester.c:11:25: error: expected primary-expression before 'int'
>11 | void foo (__extension__ int a);