This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Feature request - a macro defined for GCC


Robert Dewar:
[ Charset ISO-8859-1 converted... ]
> Andrew Haley wrote:
> > x z wrote:
> > 
> >> 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.
> > 
> > They don't use GNU CPP.
> > 
> >> Therefore, the fact that __GNUC__ is defined does not necessarily
> >> mean the GCC compiler proper is being used.
> > 
> > I don't think you've thought about this thoroughly.
> > 
> > Any compiler that is not GNU C but defines __GNUC__ is lying to its
> > users.  If we define __REAL_GNUC__ they'll just define that as well.

I guess the last reply didn't make it to the list.  The include files
need __GNUC__ and other builtin macros to include type definitions.
The builtin macros aren't needed by the compiler proper, and adding
another builtin wouldn't help in special cases.  For example, the
GNU configurations occationionally need to use -DWITH_GCC or something
similar.  

I didn't know that anyone had a special claim to GNU and/or GCC.  I
thought the trademark thing was tried, but, with all of the instances
of GCC already on bookshelves, for example, it didn't seem very
successful.  But, IANTL, of course.

--
Add this signature to your message and contribute to world nomidation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]