This is the mail archive of the
mailing list for the GCC project.
Re: -std's (was Re: v3 link failures analyzed)
Joseph S Myers <email@example.com> writes:
> Use of -std flags for strict standard versions does define
> __STRICT_ANSI__. Use of -std=gnu89 / -std=gnu99 doesn't. -std=gnu99
> should become the default when it's ready.
> (Glibc uses __STRICT_ANSI__ in conjunction with __STDC_VERSION__ to
> determine what standard functions to define - i.e., with -std=c99 you get
> all C99 functions.)
So will there be a way to get all possible standard compliance warnings
with the sole exception of what functions are available in the system
-ansi currently does several things in addition to affect the system
header namespace (it disables // comments, enables trigraphs, changes the
namespace of the preprocessor symbols the compiler defines, and disables
the additional keywords added by gcc that are normally in the user
namespace). Some of those things also have other switches, but basically
I'd ideally like to get at all of the other features of a -std switch
*except* the namespace, because in my experience it's practical and often
desireable to turn on everything else in portable software but it's never
a good idea to try to use the feature macros to get things like fdopen().
My understanding is that -std=gnu99 won't do what I want, as it will also
enable various other non-portable extensions to the language.
Russ Allbery (firstname.lastname@example.org) <http://www.eyrie.org/~eagle/>