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: Gordon Sadler <gbsadler1 at lcisp dot com>
- Date: Sun, 29 Jul 2001 16:03:52 -0500
On Sun, Jul 29, 2001 at 09:37:15PM +0100, Joseph S. Myers wrote:
> On Sun, 29 Jul 2001, Gordon Sadler wrote:
>
> > macro is defined at all times. (As an aside, gcc.texi claims when better
> > support for the c99 standard is included with gcc it will become the
> > default, hence my reason to change the default for now to iso9899:199409.
> > Previous behavior is still possible with -ansi).
>
> Before we can change to anything from gnu89 as default, we need a -Wc89
> option to warn in those places where -std=gnu89 -pedantic warns, so that
> programs such as GCC itself now using -pedantic for portability can still
> get the warnings without forcing the compiler into an old standard mode.
> (It hasn't yet been felt worthwhile to add a gnu94 option - which is what
> you seem to be proposing.)
>
I think I understand this. You can't change the default to
c89+amend1+gnu unless/until a gnu94 option is present. Ok.
My basis for all of this stems from the fact that 2.95.x and 3.x both
default to gnu89. Under 2.95.x __STDC_VERSION__ is defined as if gcc is
compliant with iso9899:199409. Under 3.x __STDC_VERSION__ is undefined
by default. If the macro is defined to indicate compliance with at least
iso9899:199409 then shouldn't 3.x define it as well? Or should the macro
only be defined when gnu extensions are not present?
It seems as though 2.95.x should never have defined the macro by
default, but it does and existing code relies on this. So should code be
compiled with gcc-3.x by default the macro is no longer available to
test with.
--
Gordon Sadler