Reputation: 7274
If I want to find out what implicit preprocessor defines gcc gives me, I can type echo "" | cpp -dD
. Does anyone know what the equivalent for clang is?
Upvotes: 33
Views: 14458
Reputation: 20286
clang "dumping processor state" options are defined here. The option you are looking for is -dM
, so you'll run:
clang -dM -E -
To trigger execution, you then need to terminate the manual input:
Otherwise, directly execute:
clang -dM -E - < NUL
clang -dM -E - < /dev/null
Upvotes: 10
Reputation: 47602
clang -dM -E - < /dev/null
will list all the preprocessor definitions for clang.
Upvotes: 64