-ansi, POSIX etc basic questions?

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

 



Hi

  I have some basic questions around compiler definitions.  I am porting some 
code which contains a mixture of BSD & SVR4 from Solaris to Linux.

  Forgive me if some of these questions are rather basic.

  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????

  2)  The sad thing is that if I use the -ansi flag it stops many of the 'C'  
files from compiling. For example MAXNAMLEN will be undefined or things like 
u_long or S_IFDIR will not be defined.  I presume that this is related to 
compiler definitions like __USE_BSD or __USE_POSIX or __USE_XOPEN etc

       Presumably -ansi is automatically turning some of these compiler 
definitions off??

      Should I be defining these definitions (as required) when I'm building 
the 'C' files using -ansi????

       Any other suggestions?

       Currently in many cases I am simply defining these defn's as part of 
the C source.....not the most ideal solution.

  3)  Can I get the compiler to somehow list out the compiler definitions 
that it is using?

  Thank You very much for your time

  Phil Prentice

[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