-std's (was Re: v3 link failures analyzed)

Joseph S. Myers jsm28@cam.ac.uk
Thu Jan 11 04:36:00 GMT 2001


On 11 Jan 2001, Russ Allbery wrote:

> According to the gcc manual, using -ansi also disables built-ins for some
> standard functions.

The builtins disabled are for non-standard functions (i.e., those not in
the specified standard edition).

> I've been worrying a little about that when seeing various very useful
> stuff that I'm going to want to take advantage of eventually be turned on
> by an appropriate -std flag.  Is using the -std flags going to cause the
> same problems that makes -ansi almost unusuable even if one really *wants*
> to tell the compiler not to define preprocessor symbols in the user
> namespace and the other useful things that -ansi does?

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.)

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc mailing list