Fwd: Re: Depending on C99 (Re: GtkBindingSignal changes)



>within compound statements.  As an extension, GCC also allows this in
>C89 mode.  For example, you could do:

IMO, this is a GCC bug... from the man page:

(-std=)
         c89
         iso9899:1990
             ISO C90 (same as -ansi).

         gnu89
             Default, ISO C90 plus GNU extensions (including some
             C99 features).

I would expect that to only be enabled if using gnu89, but indeed mixed 
declarations and code do compile with -ansi or -std=c89. The only way to cause 
this to generate warnings AFAIK is -pedantic:

$ gcc -std=c89 -o g g.c
$ gcc -std=c89 -pedantic -o g g.c
g.c: In function `main':
g.c:8: warning: ISO C89 forbids mixed declarations and code

This could have changed in newer GCC versions, but this is with 3.3.4.

Andrew Paprocki
Bloomberg LP






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]