Subject: Re: System includes C++ safe?
To: matthew green <mrg@eterna.com.au>
From: James Chacon <jmc@NetBSD.org>
List: tech-toolchain
Date: 12/26/2003 00:04:03
On Fri, Dec 26, 2003 at 04:17:18PM +1100, matthew green wrote:
> 
>    See PR#20421, share/mk/bsd.prog.mk rev 1.175 and GCC bug 7327 for some
>    additional background.
>    
>    Basically doing this:
>    
>    cat > /tmp/test.cpp <<EOF
>    #include <map>
>    EOF
>    g++ -c -nostdinc++ -isystem /usr/include/g++ /tmp/test.cpp
>    
>    Will blow up with lots of errors about templates inside of traditional C
>    code. 
>    
>    Turns out this is due to NetBSD hosts not defining NO_IMPLICIT_EXTERN_C
>    in the gcc config. 
>    
>    Since we don't use fixincludes and otherwise assume our headers are fine, is
>    there any reason not to define this? i.e. everything is wrapped in 
>    BEGIN_DECLS (or should be) which DTRT for c++ vs non-c++ code.
> 
> 
> use -isystem-cxx.

Ok, that does solve the first issue. The 2nd point though...Why shouldn't
we enable NO_IMPLICIT_EXTERN_C? If the system includes are C++ safe (which
they are) and we don't use fixincludes there's no real reason for this I
can see.

James