You are here

How to find out which preprocessor symbols are defined for C/C++ compiler

Ivan Radovanovic's picture

Run compiler with arguments -dM -E -xc++ /dev/null. (-x specifies language, so if you want to see predefined symbols for C, you should use -xc instead of -xc++).

For example:
clang -dM -E -xc++ /dev/null

or
gcc -dM -E -xc++ /dev/null