It various situation, it is very useful to get the list of all defined maco after gcc preprocessing.
Particularly when porting C/C++ source code to another OS/Architecture to know what macro to use to identify it.
A simple way is to use gcc with the following options:
-E to end after preprocessing step,
-dM to print all defined macros.
For instance to known the "default" macros, use those options with a simple source code file "test.c" defining a main function:
gcc -E -dM test.c