This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -ansi, POSIX etc basic questions?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]