Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What symbols are automatically defined by Linuxs GCC ?

0
Posted

What symbols are automatically defined by Linuxs GCC ?

0

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123