Re: -ansi, POSIX etc basic questions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Phil Prentice <philp.cheer@xxxxxxxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux