Feature request - a macro defined for GCC

x z hzmonte@hotmail.com
Tue Jul 1 05:34:00 GMT 2008


I would like to see that GCC define a macro in the case it is being used to compile a program. Currently there is a __GNUC__ macro defined by the GNU C preprocessor CPP.  That does not suit the need.  As the CPP Manual says: __GNUC__ is "defined by all GNU compilers that use the C preprocessor".  It seems to imply that any (non-GNU) compiler that uses the GNU C preprocessor would also have __GNUC__ defined.  According to their respective manuals, Intel C++ Compiler and Portable C Compiler also pre-define __GNUC__, possibly because they use the GNU CPP.  Therefore, the fact that __GNUC__ is defined does not necessarily mean the GCC compiler proper is being used.  There is a need for a macro that definitely confirms that GCC is being used.  (It is another matter if another complier deliberately misleads people by defining the same macro.) And I hope that macro can be documented in the GCC Manual.

_________________________________________________________________
Need to know now? Get instant answers with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_062008



More information about the Gcc mailing list