-ansi, POSIX etc basic questions?
Ian Lance Taylor
ian@wasabisystems.com
Fri Sep 24 21:02:00 GMT 2004
Phil Prentice <philp.cheer@btinternet.com> writes:
> 1) I have been using the -ansi flag definition, because that seemed the
> right thing to do? I seem to remember that -ansi will (where possible) check
> prototyping and will define the __STDC__ definition.
> Am I correct to be trying to use this -ansi flag????
Probably not. In general -ansi puts the compiler into strict ANSI C
mode (really ISO C mode). In particular it tells the header files to
restrict themselves to symbols which are defined in the ISO C
standard. Few useful programs are written that way.
The main purpose for -ansi is to pass testsuites. It would be useful
for programs which written in strict ISO C, but very few programs are
in fact written that way.
When compiling existing source code, -ansi is pretty much never
appropriate unless the program explicitly calls for it.
Ian
More information about the Gcc-help
mailing list