Is there a way for gcc/g++ to dump its preprocessor defines from the command line?
I mean things like __GNUC__
, __STDC__
, and so on.
GCC dump preprocessor defines
c-preprocessorg++gcc
Related Topic
- Linux – How to add a default include path for GCC in Linux
- Using GCC to produce readable assembly
- Disable all gcc warnings
- How to force make/GCC to show me the commands
- Why doesn’t GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)
- Linux – Why does the C preprocessor interpret the word “linux” as the constant “1”
- R – Drupal: retrieve data from multiple node types in views 2
Best Answer
Yes, use
-E -dM
options instead of -c. Example (outputs them to stdout):For C++
From the gcc manual: