This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -std=c89 shouldn't allow post-statement declarations
On Wed, Jul 23, 2003 at 12:22:08AM +0100, Joseph S. Myers wrote:
> On Tue, 22 Jul 2003, Jamie Zawinski wrote:
>
> > It might be sensible for this to be allowed with -std=gnu89, but
> > -std=c89 should not allow syntax that was not a part of the C89 spec.
>
> As you know from the manual, -std=c89 means "accept standard code" while
> -pedantic means "reject nonstandard code".
We could make this argument, but is it the most useful behavior for the
user? It seems Jamie was expecting "C89 but not fussy" because he was
interested in writing portable C code.
-std=c89 should do very little
> (since in general we should accept standard code anyway): it defines
> __STRICT_ANSI__, reducing header namespaces and so requiring feature test
> macros to use POSIX etc. functions; it disables predefined macros such as
> "linux" that are in the user's namespace; it enables trigraphs; it
> disables digraphs and a few other lexer features such as C++ comments and
> hex floats that in rare cases affect the meaning of valid code;
Ah: we disable one extension from C++ (the // comments), but we leave in
the other C++-based extension (declarations anywhere). This seems inconsistent.