This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc -std=c89 -xc++ undefines __cplusplus
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Sat, 24 Aug 2002 09:04:34 +0100
- Subject: Re: gcc -std=c89 -xc++ undefines __cplusplus
- References: <20020824040032.95164.qmail@web14508.mail.yahoo.com>
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.