This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]