This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Feature request - a macro defined for GCC
- From: x z <hzmonte at hotmail dot com>
- To: <gcc at gnu dot org>
- Date: Tue, 1 Jul 2008 05:33:24 +0000
- Subject: Feature request - a macro defined for GCC
- References: <BLU125-W17EAD8591F0443962FC5E5A09E0@phx.gbl>
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