What symbols are automatically defined by Linuxs GCC ?
Ans: Symbols defined are `linux’, `__unix__’, `__i386__’, `__linux__’, `__unix’, `__i386′, `__linux’. You can get a correct list by using the flag -v to gcc whilst compilation. P.s. One should note that even though the compiler automatically defines “linux” in a program, this is *not* POSIX compliant. Instead __linux__ should be used in programs that need operating-system specific compilation, since __linux__ *is* POSIX compliant. This means you can wrap your linux specific code around (for example) #ifdef __linux__ …[linux specific code here]… #endif /* ifdef linux */ without adding anything extra to the Makefile defines etc.. You can also add your own defines to the file /usr/lib/gcc-lib/i486-linux/2.6.