public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Zack Weinberg <zack@codesourcery.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
Date: Tue, 19 Mar 2002 01:36:00 -0000	[thread overview]
Message-ID: <20020319093601.5876.qmail@sources.redhat.com> (raw)

The following reply was made to PR c++/5997; it has been noted by GNATS.

From: Zack Weinberg <zack@codesourcery.com>
To: Jorgo Bakker <jbakker@rssd.esa.int>
Cc: Neil Booth <neil@daikokuya.demon.co.uk>, 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 01:27:05 -0800

 On Tue, Mar 19, 2002 at 10:06:12AM +0100, Jorgo Bakker wrote:
 > >
 > > You're quite right - I'd not tested the PR, assuming it must be right.
 > > I just looked for when the last time this area of code was changed.  I
 > > can't reproduce it either.  jbakker, can you elaborate on what problem
 > > you're seeing?
 > >
 > > Neil.
 > 
 > Hmm, I started to doubt myself, and indeed: on Linux it works fine. However,
 > my sun-sparc-solaris2.[6-8] platforms all give the following output.
 > It seems as if CPLUS_INCLUDE_PATH is interpreted as a PATH to C-include files
 > only; hence the error.
 
 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


             reply	other threads:[~2002-03-19  9:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-19  1:36 Zack Weinberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-20 10:15 neil
2002-03-20  2:16 Jorgo Bakker
2002-03-19 11:46 Neil Booth
2002-03-19  2:06 Jorgo Bakker
2002-03-19  1:16 Jorgo Bakker
2002-03-18 11:36 Neil Booth
2002-03-18 11:16 Zack Weinberg
2002-03-18 10:26 Neil Booth
2002-03-18  8:16 jbakker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020319093601.5876.qmail@sources.redhat.com \
    --to=zack@codesourcery.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).