public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Which standard is the default for -std?
@ 2010-03-09 17:11 John Rocha
  2010-03-10 16:07 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: John Rocha @ 2010-03-09 17:11 UTC (permalink / raw)
  To: gcc-help

Hello All,

I was reading and found the '-std' flag for C++ compilation using the 
[gcc] compiler.

My man page for [gcc] indicates:

   1. gnu89
      is the default value "Default, ISO C90 plus GNU extension
      (including some C(features)".
   2. gnu99
      "ISO C99 plus GNU extension. When IOS C99 is fully implemented in
      GCC this will become the default."

The version of [g++/gcc] I am using is as 4.1.2 20070115 (detailed 
listing shown at end) for Linux on a SUSE 10 SP1 machine.

I went to gnu.org, navigated to the latest documentation for [g++/gcc] 
and found 4.4.3 20100121. The PDF documentation for 4.4.3 describes the 
'-std' options the same way: gnu89 is the current default, gnu99 is the 
planned to be the future default.

Is this still true? Is gnu89 still the default, or is this a case where 
the compiler was updated but the documentation wasn't? [Three years 
seems a long time to implement a standard -- but I'm being a demanding 
customer, eh? :)]

So, is gnu89 still the default for the '-std' flag?

Secondly, is there some flag or option that displays the settings, even 
the default settings that are in use? I know, RTFM and trust in it, but 
I've been burned by outdated documentation a few times. Hence my 
apprehension.

Thanks in advance for your time,

-=John


Detailed listing for my version of g++/gcc.
--------------------------------------------------------------------------------
g++ -v
Using built-in specs.
Target: i586-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr 
--with-local-prefix=/usr/local --infodir=/usr/share/info 
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib 
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada 
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.2 
--enable-ssp --disable-libssp --disable-libgcj --with-slibdir=/lib 
--with-system-zlib --enable-shared --enable-__cxa_atexit 
--enable-libstdcxx-allocator=new --program-suffix= 
--enable-version-specific-runtime-libs --without-system-libunwind 
--with-cpu=generic --host=i586-suse-linux
Thread model: posix
gcc version 4.1.2 20070115 (prerelease) (SUSE Linux)
--------------------------------------------------------------------------------

-- 
Thought for the day: "2 much txting mks u 1 bad splr!!!!"

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Which standard is the default for -std?
  2010-03-09 17:11 Which standard is the default for -std? John Rocha
@ 2010-03-10 16:07 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2010-03-10 16:07 UTC (permalink / raw)
  To: John Rocha; +Cc: gcc-help

John Rocha <jrr@cisco.com> writes:

> My man page for [gcc] indicates:
>
>   1. gnu89
>      is the default value "Default, ISO C90 plus GNU extension
>      (including some C(features)".
>   2. gnu99
>      "ISO C99 plus GNU extension. When IOS C99 is fully implemented in
>      GCC this will become the default."
>
> The version of [g++/gcc] I am using is as 4.1.2 20070115 (detailed
> listing shown at end) for Linux on a SUSE 10 SP1 machine.
>
> I went to gnu.org, navigated to the latest documentation for [g++/gcc]
> and found 4.4.3 20100121. The PDF documentation for 4.4.3 describes
> the '-std' options the same way: gnu89 is the current default, gnu99
> is the planned to be the future default.
>
> Is this still true?

Yes.

> So, is gnu89 still the default for the '-std' flag?

Yes.

I don't really know how we would decide to change the default.  The
handling of non-static inline functions is different in GNU89 and
C99/GNU99 modes.  This happened because inline functions do not exist
in C89, and C99 choose to follow C++, which is not how GNU89 behaves.
Changing the default is sure to break some currently working programs
(the -fgnu89-inline option can be used to restore the GNU89 inline
behaviour when in C99/GNU99 mode).  This incompatibility means that
flipping the default is not something to be done casually.


> Secondly, is there some flag or option that displays the settings,
> even the default settings that are in use? I know, RTFM and trust in
> it, but I've been burned by outdated documentation a few times. Hence
> my apprehension.

You can see the status of many options using -fverbose-asm and looking
in the .s file, but unfortunately the -std option doesn't seem to be
one of them.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-10 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-09 17:11 Which standard is the default for -std? John Rocha
2010-03-10 16:07 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).