Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What C preprocessor macros have already been defined in gcc?

In gcc, how can I check what C preprocessor definitions are in place during the compilation of a C program, in particular what standard or platform-specific macro definitions are defined?

like image 831
Adrian Panasiuk Avatar asked Jul 27 '09 05:07

Adrian Panasiuk


1 Answers

Predefined macros depend on the standard and the way the compiler implements it.

For GCC: http://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html

For Microsoft Visual Studio 8: http://msdn.microsoft.com/en-us/library/b0084kay(VS.80).aspx

This Wikipedia page http://en.wikipedia.org/wiki/C_preprocessor#Compiler-specific_predefined_macros lists how to dump at some of the predefined macros

like image 60
CsTamas Avatar answered Oct 26 '22 02:10

CsTamas