You can view all the predefined macros through command-line switches with some compilers. This works with gcc and icc (Intel’s C++ compiler):

$ touch empty.cpp

$ g++ -E -dM empty.cpp | sort >gxx-macros.txt

$ icc -E -dM empty.cpp | sort >icx-macros.txt

$ touch empty.c

$ gcc -E -dM empty.c | sort >gcc-macros.txt

$ icc -E -dM empty.c | sort >icc-macros.txt
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s