egcs / g++ conflicts c++ draft standard (i think)

Martin von Loewis martin@mira.isdn.cs.tu-berlin.de
Sat Jul 25 13:28:00 GMT 1998


> I think that this warning should also be given, or probably even
> be turned into an error, when compiling with -ansi :

The semantics of -ansi might be confusing, but is well-documented:

>> This turns off certain features of GNU C that are incompatible with
>> ANSI C. ... The `-ansi' option does not cause non-ANSI programs to
>> be rejected gratuitously.  For that, `-pedantic' is required in
>> addition to `-ansi'.

So -ansi means that, in case of ambiguities, the ANSI C/C++ semantics
takes precedence over GNU C/C++.

If certain code cannot be mistaken for something else, GNU extensions
are still available with -ansi.

If you want all the diagnostics required for illegal input, you have
to give -pedantic:

>> Issue all the warnings demanded by strict ANSI C and ISO C++;
>> reject all programs that use forbidden extensions.

Regards,
Martin



More information about the Gcc mailing list