public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-18  8:16 jbakker
  0 siblings, 0 replies; 10+ messages in thread
From: jbakker @ 2002-03-18  8:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5997
>Category:       c++
>Synopsis:       CPLUS_INCLUDE_PATH not working properly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 18 08:16:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jorgo Bakker
>Release:        gcc version 3.0.4
>Organization:
>Environment:
sparc-sun-solaris2.8, sparc-sun-solaris2.7, sparc-sun-solaris2.6
i486-suse-linux (Linux 2.4.10-64GB-SMP)
>Description:
With the introduction of GCC 3, usage of CPLUS_INCLUDE_PATH seems to be valid for C-headers only.


Is this ever repaired?
>How-To-Repeat:
tar xzf foo.tgz
CPLUS_INCLUDE_PATH=`pwd`/include c++ -c  main.cc ; echo $?
>Fix:
Workaround: c++ -c -Iinclude main.cc
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="foo.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.tgz"

H4sIAI8PljwAA+3VwUrEMBAG4J7zFMP2sntZJ27SHPZhpDYpjVtT6LZexHc3XeNhRRSEVMH/u0wa
ApkwHcaHpp+tuykyYlZstI6R2Rh1iVK9xaRgo5RWXB10XMtb1rIgnTOpd/N5qkei4uG+Pp3c+MU5
N57XSGhdPtW/HYZ9l+kOlsxVqvdn9Zfy8LH+xuiCOFM+V/55/UvfButaivW/60QZlz649CWeBm+p
q4Pt3daHaXe82mn7oV72ROmC9a347afADzzWPuybJusd3/U/L7Mh9b+SMp6XlVbo/zWUaQDQ5jIB
NkLERqflr9juxLMgGt00j4H4KF7Q4QAAAAAAAAAAAAAAAAAAAH/TK4qj458AKAAA


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-20 10:15 neil
  0 siblings, 0 replies; 10+ messages in thread
From: neil @ 2002-03-20 10:15 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jbakker, nobody

Synopsis: CPLUS_INCLUDE_PATH not working properly

State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Wed Mar 20 10:14:59 2002
State-Changed-Why:
    Different environment variable used instead (CPATH).

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5997


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-20  2:16 Jorgo Bakker
  0 siblings, 0 replies; 10+ messages in thread
From: Jorgo Bakker @ 2002-03-20  2:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Jorgo Bakker <jbakker@rssd.esa.int>
To: Neil Booth <neil@daikokuya.demon.co.uk>
Cc: Zack Weinberg <zack@codesourcery.com>, gcc-gnats@gcc.gnu.org,
	 gcc-bugs@gcc.gnu.org
Subject: Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
Date: Wed, 20 Mar 2002 11:14:38 +0100

 That would do the trick, thanks ;-).
 
 You may want to consider either to reimplement the build config for
 solaris or to redoc CPLUS_INCLUDE_PATH, C_INCLUDE_PATH etc..., as it now
 is confusing (different behavior) and misleading.
 
 Thanks for your help.
 
 Jorgo Bakker
 
 Neil Booth wrote:
 
 > Zack Weinberg wrote:-
 >
 > > 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".
 >
 > In that case, would the environment variable that is now documented
 > in 3.1 and 3.2, "CPATH", work instead?  GCC has supported it for a long
 > time, it just hasn't been documented.  It treats its path components as
 > if specified with -I.
 >
 > http://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html
 >
 > Neil.
 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-19 11:46 Neil Booth
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Booth @ 2002-03-19 11:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Neil Booth <neil@daikokuya.demon.co.uk>
To: Zack Weinberg <zack@codesourcery.com>
Cc: Jorgo Bakker <jbakker@rssd.esa.int>, 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 19:41:07 +0000

 Zack Weinberg wrote:-
 
 > 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".
 
 In that case, would the environment variable that is now documented
 in 3.1 and 3.2, "CPATH", work instead?  GCC has supported it for a long
 time, it just hasn't been documented.  It treats its path components as
 if specified with -I.
 
 http://gcc.gnu.org/onlinedocs/cpp/Environment-Variables.html
 
 Neil.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-19  2:06 Jorgo Bakker
  0 siblings, 0 replies; 10+ messages in thread
From: Jorgo Bakker @ 2002-03-19  2:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Jorgo Bakker <jbakker@rssd.esa.int>
To: Zack Weinberg <zack@codesourcery.com>
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 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
 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-19  1:36 Zack Weinberg
  0 siblings, 0 replies; 10+ messages in thread
From: Zack Weinberg @ 2002-03-19  1:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-19  1:16 Jorgo Bakker
  0 siblings, 0 replies; 10+ messages in thread
From: Jorgo Bakker @ 2002-03-19  1:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Jorgo Bakker <jbakker@rssd.esa.int>
To: Neil Booth <neil@daikokuya.demon.co.uk>
Cc: Zack Weinberg <zack@codesourcery.com>, 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 10:06:12 +0100

 Neil Booth wrote:
 
 > Zack Weinberg wrote:-
 >
 > > On Mon, Mar 18, 2002 at 06:25:00PM +0000, Neil Booth wrote:
 > > >
 > > > I *think* this goes back 3 years (before my time!) to your change to
 > > > cppinit.c 1.5 -> 1.6.  Would you have a look at it?  We used to put
 > > > the paths in the env var before the default paths.  Now we do something
 > > > that is a little different I think.
 > >
 > > I'm not seeing any problem at all... could you please tell me what's
 > > going wrong in your environment?
 > >
 > > ~/f $ CPLUS_INCLUDE_PATH=`pwd`/include g++ -c -H main.cc ; echo $?
 > > /home/zack/f/include/foo.h
 > > 0
 > > ~/f $ CPLUS_INCLUDE_PATH=`pwd`/include g++-3.0 -c -H main.cc ; echo $?
 > > . /home/zack/f/include/foo.h
 > > 0
 > > ~/f $ CPLUS_INCLUDE_PATH=`pwd`/include ~/src/gcc/b/vanilla/gcc/g++ \
 > >   -B ~/src/gcc/b/vanilla/gcc/ -H -c main.cc ; echo $?
 > > . /home/zack/f/include/foo.h
 > > 0
 >
 > 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.
 
 Jorgo
 
 ---
 $ CPLUS_INCLUDE_PATH=`pwd`/include /usr/local/devel/gcc-3.0.4/bin/g++ -v  -c
 -H  main.cc
 Reading specs from
 /usr/local/devel/gcc-3.0.4/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/specs
 Configured with: ../gcc-3.0.4-src/configure
 --prefix=/usr/local/devel/gcc-3.0.4 --with-gnu-as --with-gnu-ld
 --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld
 --enable-shared=libstdc++ --disable-threads
 Thread model: single
 gcc version 3.0.4
  /usr/local/devel/gcc-3.0.4/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/cc1plus -v
 -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=4 -Dsparc -Dsun -Dunix
 -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4
 -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__NO_INLINE__
 -D__STDC_HOSTED__=1 -H -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1
 -D_LARGEFILE64_SOURCE=1 -D__EXTENSIONS__ -D__GCC_NEW_VARARGS__ -Acpu=sparc
 -Amachine=sparc main.cc -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS
 -D__GXX_ABI_VERSION=100 -quiet -dumpbase main.cc -version -o
 /data/Users/jbakker/tmp/ccpp6A4E.s
 GNU CPP version 3.0.4 (cpplib) (sparc)
 GNU C++ version 3.0.4 (sparc-sun-solaris2.8)
         compiled by GNU C version 3.0.4.
 ignoring nonexistent directory
 "/usr/local/devel/gcc-3.0.4/sparc-sun-solaris2.8/include"
 #include "..." search starts here:
 #include <...> search starts here:
  /data/Users/jbakker/tmp/gcc-bug/foo/tmp/include
  /usr/local/devel/gcc-3.0.4/include/g++-v3
  /usr/local/devel/gcc-3.0.4/include/g++-v3/sparc-sun-solaris2.8
  /usr/local/devel/gcc-3.0.4/include/g++-v3/backward
  /usr/local/include
  /usr/local/devel/gcc-3.0.4/include
  /usr/local/devel/gcc-3.0.4/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/include
  /usr/include
 End of search list.
 . /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
 
 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-18 11:36 Neil Booth
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Booth @ 2002-03-18 11:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Neil Booth <neil@daikokuya.demon.co.uk>
To: Zack Weinberg <zack@codesourcery.com>
Cc: jbakker@rssd.esa.int, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
Date: Mon, 18 Mar 2002 19:33:17 +0000

 Zack Weinberg wrote:-
 
 > On Mon, Mar 18, 2002 at 06:25:00PM +0000, Neil Booth wrote:
 > > 
 > > I *think* this goes back 3 years (before my time!) to your change to
 > > cppinit.c 1.5 -> 1.6.  Would you have a look at it?  We used to put
 > > the paths in the env var before the default paths.  Now we do something
 > > that is a little different I think.
 > 
 > I'm not seeing any problem at all... could you please tell me what's
 > going wrong in your environment?
 > 
 > ~/f $ CPLUS_INCLUDE_PATH=`pwd`/include g++ -c -H main.cc ; echo $?
 > /home/zack/f/include/foo.h
 > 0
 > ~/f $ CPLUS_INCLUDE_PATH=`pwd`/include g++-3.0 -c -H main.cc ; echo $?
 > . /home/zack/f/include/foo.h
 > 0
 > ~/f $ CPLUS_INCLUDE_PATH=`pwd`/include ~/src/gcc/b/vanilla/gcc/g++ \
 >   -B ~/src/gcc/b/vanilla/gcc/ -H -c main.cc ; echo $?
 > . /home/zack/f/include/foo.h
 > 0
 
 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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-18 11:16 Zack Weinberg
  0 siblings, 0 replies; 10+ messages in thread
From: Zack Weinberg @ 2002-03-18 11:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Zack Weinberg <zack@codesourcery.com>
To: Neil Booth <neil@daikokuya.demon.co.uk>
Cc: jbakker@rssd.esa.int, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
Date: Mon, 18 Mar 2002 11:08:42 -0800

 On Mon, Mar 18, 2002 at 06:25:00PM +0000, Neil Booth wrote:
 > 
 > I *think* this goes back 3 years (before my time!) to your change to
 > cppinit.c 1.5 -> 1.6.  Would you have a look at it?  We used to put
 > the paths in the env var before the default paths.  Now we do something
 > that is a little different I think.
 
 I'm not seeing any problem at all... could you please tell me what's
 going wrong in your environment?
 
 ~/f $ CPLUS_INCLUDE_PATH=`pwd`/include g++ -c -H main.cc ; echo $?
 /home/zack/f/include/foo.h
 0
 ~/f $ CPLUS_INCLUDE_PATH=`pwd`/include g++-3.0 -c -H main.cc ; echo $?
 . /home/zack/f/include/foo.h
 0
 ~/f $ CPLUS_INCLUDE_PATH=`pwd`/include ~/src/gcc/b/vanilla/gcc/g++ \
   -B ~/src/gcc/b/vanilla/gcc/ -H -c main.cc ; echo $?
 . /home/zack/f/include/foo.h
 0
 
 zw


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
@ 2002-03-18 10:26 Neil Booth
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Booth @ 2002-03-18 10:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Neil Booth <neil@daikokuya.demon.co.uk>
To: jbakker@rssd.esa.int, Zack Weinberg <zack@codesourcery.com>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: c++/5997: CPLUS_INCLUDE_PATH not working properly
Date: Mon, 18 Mar 2002 18:25:00 +0000

 jbakker@rssd.esa.int wrote:-
 
 > >Description:
 > With the introduction of GCC 3, usage of CPLUS_INCLUDE_PATH seems to be valid for C-headers only.
 > 
 > 
 > Is this ever repaired?
 > >How-To-Repeat:
 > tar xzf foo.tgz
 > CPLUS_INCLUDE_PATH=`pwd`/include c++ -c  main.cc ; echo $?
 > >Fix:
 > Workaround: c++ -c -Iinclude main.cc
 
 Zack,
 
 I *think* this goes back 3 years (before my time!) to your change to
 cppinit.c 1.5 -> 1.6.  Would you have a look at it?  We used to put
 the paths in the env var before the default paths.  Now we do something
 that is a little different I think.
 
 Neil.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-03-20 18:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-18  8:16 c++/5997: CPLUS_INCLUDE_PATH not working properly jbakker
2002-03-18 10:26 Neil Booth
2002-03-18 11:16 Zack Weinberg
2002-03-18 11:36 Neil Booth
2002-03-19  1:16 Jorgo Bakker
2002-03-19  1:36 Zack Weinberg
2002-03-19  2:06 Jorgo Bakker
2002-03-19 11:46 Neil Booth
2002-03-20  2:16 Jorgo Bakker
2002-03-20 10:15 neil

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).