This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 'extern "C" { ...}' and 'ANSI C++ forbids ...'
- To: Konstantin Baumann <kostab at math dot uni-muenster dot de>
- Subject: Re: 'extern "C" { ...}' and 'ANSI C++ forbids ...'
- From: kthomas at gwdg dot de (Philipp Thomas)
- Date: Thu, 15 Jul 1999 21:40:21 GMT
- Cc: egcs at egcs dot cygnus dot com, egcs-patches at egcs dot cygnus dot com
- References: <378DC6EF.B77D653D@math.uni-muenster.de>
On Thu, 15 Jul 1999 13:33:03 +0200, Konstantin Baumann
<kostab@math.uni-muenster.de> wrote:
> /usr/openwin/include/X11/Xlib.h:2071: ANSI C++ forbids declaration
> `XActivateScreenSaver' with no type
>I think this an error, because the <X11/Xlib.h>-header-file is included in
>"C"-mode not in "C++"-mode!
No, this is correct. 'extern C' only tells a compiler that name
mangling does't apply. In all other respects the code has to follow
the C++ standard.
>Is there a switch to turn this behavior off (or a workaround)?
If you don't want an error, use '-fpermissive', but AFAIK you'll still
get a warning. If you want to completely get rid of it correct the
header. BTW, C9X will also ban 'implicit int'
declarations/definitions.
Philipp
--
Close the windows! The penguin is freezing.