Jan 22

Display list of all predefined macros in GCC

Tag: C/C++Dan @ 5:17 pm

Something I always forget and have to look up.

1) Print predefined macros:

gcc -dM -E - </dev/null | sort | less

2) Print predefined macros and macros introduced by a specific header

echo “#include <stdlib.h>” > foo.h

gcc -dM -E foo.h | sort | less

Reference for -dM is in the cpp man page.

Leave a Reply

*
To prove you're a person (not a spam script), type the answer to the math equation shown in the picture. Click on the picture to hear an audio file of the equation.
Click to hear an audio file of the anti-spam equation