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: gcc -std=c89 -xc++ undefines __cplusplus


Danny Smith wrote:-

> Specifying -std=c89 with -xc++ undefines __cplusplus, but
> leaves __GNUG__ defined.

I suggest you don't do this; -std=c89 is not a C++ switch
and 3.3 will tell you that (I originally had it an error,
but was asked to make it a warning.  Trying it out now
gives

$ gcc -std=c89 -x c++ /tmp/foo.c
cc1plus: warning: "-std=c89" is valid for C/ObjC but not for C++
cc1plus: error: unrecognized option `-std=c89'

so it's both 8-)  I need to fix this.)

Neil.


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