Go to main content
Oracle® Developer Studio 12.6: GCC Compatibility Guide

Exit Print View

Updated: June 2017
 
 

Header File Compatibility

GCC and Oracle Developer Studio compilers predefine different symbols.

Use the following command to view the symbols that are predefined by gcc for C and C++:

$ gcc -E -dM -xc /dev/null
$ g++ -E -dM -xc++ /dev/null

Use the following command to view the symbols that are predefined by Oracle Developer Studio C and C++ compilers:

$ cc -xdumpmacros -E /dev/null
$ CC -xdumpmacros -E /dev/null

Use of various compiler options can affect the predefined macros and their values for all compilers. The –m32|–m64 options and the language options (std=v) in particular affect predefined macros.

This output also includes source code defining the _GNU_SOURCE macro, which is used to enable header file declarations for various non-portable functions, defined mostly in glibc. Fore more information, see http://stackoverflow.com/questions/5582211/what-does-define-gnu-sourceimply.