This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __STDC_VERSION__ is undefined in gcc-3.x?
- To: gcc at gcc dot gnu dot org
- Subject: Re: __STDC_VERSION__ is undefined in gcc-3.x?
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Sun, 29 Jul 2001 20:56:03 +0100
Gordon Sadler wrote:-
> 2.95.x no matter which -std=xxx I pass it always returns 199409. Under 3.x,
> unless I specify one of the -std=c9x options or gnu9x __STDC_VERSION__ is
> undefined. So it appears -ansi (aka -std=c89) should not define
> __STDC_VERSION__? In that case, 2.95.x is wrong?
I believe all of this to be true. But 2.95 does not use cpplib by
default, and therefore cppinit.c, I believe. You might need to look
at cccp.c, which could do a different thing (I don't have a copy of it
handy).
> and perhaps the default for
> at least the 3.x-branch should be changed to 'iso9899:199409'?
I think the current behaviour is what we want. Since C89 compilers do
not define the macro, it is supposed to be a way for programs to check
whether they are being compiled by a C89 compiler or not.
Neil.