From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14339 invoked by alias); 19 Mar 2002 10:06:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 14312 invoked by uid 71); 19 Mar 2002 10:06:01 -0000 Date: Tue, 19 Mar 2002 02:06:00 -0000 Message-ID: <20020319100601.14309.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Jorgo Bakker Subject: Re: c++/5997: CPLUS_INCLUDE_PATH not working properly Reply-To: Jorgo Bakker X-SW-Source: 2002-03/txt/msg00700.txt.bz2 List-Id: The following reply was made to PR c++/5997; it has been noted by GNATS. From: Jorgo Bakker To: Zack Weinberg Cc: Neil Booth , gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org Subject: Re: c++/5997: CPLUS_INCLUDE_PATH not working properly Date: Tue, 19 Mar 2002 11:02:05 +0100 Zack Weinberg wrote: > Oh! I see what the problem is now. > > > . /data/Users/jbakker/tmp/gcc-bug/foo/tmp/include/foo.h > > In file included from main.cc:1: > > /data/Users/jbakker/tmp/gcc-bug/foo/tmp/include/foo.h:5: declaration of C > > function `void handle(float)' conflicts with > > /data/Users/jbakker/tmp/gcc-bug/foo/tmp/include/foo.h:4: previous declaration > > `void handle(int)' here > > It is reading the header file you asked it to, but interpreting that > file as a "system header" - and on sparc-sun-solaris2.x, "system > headers" get treated as wrapped in an implicit extern "C". > > I'm not inclined to change what *_INCLUDE_PATH do - there are probably > people out there depending on having them be system headers. You can > work around the problem by putting extern "C++" { ... } around the > entire content of your header file. > > Also, the sparc-sun-solaris* configurations should probably be changed > to disable the implicit extern "C". If I remember correctly, Solaris > has had extern "C" in its header files from day one. > > zw I have been using GCC from version 2.7 onwards (including many flavours of it in terms of EGCS), and with the introduction of GCC-3 the behavior of CPLUS_INCLUDE_PATH has changed. As you have noticed, GCC-3 behaves different on Linux. Your recommendations about changing the sparc-sun-solaris* configs would do the trick. To me it seems that C_INCLUDE_PATH is reserved for C-header files ;-) Hope to see this 'solaris specific feature' disappearing in future. Cheers - Jorgo