This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Strange pedantic error message
- To: dewar at gnat dot com, pfeifer at dbai dot tuwien dot ac dot at
- Subject: Re: Strange pedantic error message
- From: dewar at gnat dot com
- Date: Thu, 8 Feb 2001 08:57:53 -0500 (EST)
- Cc: fjh at cs dot mu dot oz dot au, gcc at gcc dot gnu dot org, jrmg at dcs dot ed dot ac dot uk
<<In engineering it's almost always a bad idea to rely on a single source
or ``vendor''. That's what standards are for.
>>
Again, please let's not be absolute, in your environment it may be important
to ensure that your code can be compiled with proprietary C compilers, and
if so, that's a perfectly reasonable viewpoint. Indeed if there were
multiple free software C compilers, then this would be a stronger issue
in the GNU environment.
The point here is to be more neutral, it is really quite inappropriate on
the gcc.gnu.org list to suggest that people should never use GNU C, which
is the language compiled by gcc.
If you want to write in GNU C, which is a perfectly reasonable thing to do,
then there are currently not too many "multiple vendors" and presumably
if there were, then they would conform to the language standard :-)
I expect the Microsoft folks feel the same way about C# !
You choose the language that makes sense to you. GNU C is a well known
and widely implemented variant of C, and it is perfectly reasonable to
program in that dialect if that is what you want to do.
If you want to write in standard C, that's also a perfectly reasonable
choice, and it turns out that, although gcc does not claim to be 100%
conformant with ANSI C (as far as I know), you can get some help from
using -pedantic, and so you should use this switch.
There is really no useful argument here, it's just a matter of using the
tools in an appropriate manner. Whether using GNU C instead of C for
your project opens up a Pandora (I think that is the usual spelling
from the Greek) 's box, is something that you have to figure out for
yourself in your own environment. Certainly it is a mistake to use
GNU C extensions if you want to write in ANSI standard C.
The gcc project has always taken the view that it is perfectly reasonable
to add useful extensions to C, hence the new dialect GNU C. Furthermore,
the decision was made that this should be the default. Certainly one can
argue what the default should be, but obviously no one would suggest changing
the default at this stage.
In the case of GNAT (Gnu Ada), we made the opposite choice on the default,
where by default all extensions are off. This reflects the requirement in
the Ada RM that no extensions are permitted (a stronger tradition in Ada :-)
And we have a separate switch -gnatX to enable extensions in the Ada case.