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]

Re: 'extern "C" { ...}' and 'ANSI C++ forbids ...'


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.


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