public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4225: bad reference in an object file caused by the include method
@ 2002-11-21 18:56 Wolfgang Bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Bangerth @ 2002-11-21 18:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/4225: bad reference in an object file caused by the include
 method
Date: Fri, 15 Nov 2002 20:04:43 -0600 (CST)

 Presently (i.e. at the 3.2.1 stage), the documentation says:
   `CPATH'
   `C_INCLUDE_PATH'
   `CPLUS_INCLUDE_PATH'
   `OBJC_INCLUDE_PATH'
      [...]
 
      `CPATH' specifies a list of directories to be searched as if
      specified with `-I', but after any paths given with `-I' options
      on the command line.  The environment variable is used regardless
      of which language is being preprocessed.
 
      The remaining environment variables apply only when preprocessing
      the particular language indicated.  Each specifies a list of
      directories to be searched as if specified with `-isystem', but
      after any paths given with `-isystem' options on the command line.
 
 I.e., only the part that -isystem implies extern "C" on some systems is 
 now missing. Or at least I could not find it anywhere -isystem is 
 mentioned.
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 


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

* Re: c++/4225: bad reference in an object file caused by the include method
@ 2001-09-04 15:27 aoliva
  0 siblings, 0 replies; 3+ messages in thread
From: aoliva @ 2001-09-04 15:27 UTC (permalink / raw)
  To: abetton, gcc-bugs, gcc-prs, nobody

Synopsis: bad reference in an object file caused by the include method

State-Changed-From-To: open->analyzed
State-Changed-By: aoliva
State-Changed-When: Tue Sep  4 15:26:59 2001
State-Changed-Why:
    I believe this is just a documentation issue.  We fail to say that CPLUS_INCLUDE_PATH marks the listed headers as system header files.  On some OSs, system header files are considered to be implicitly surrounded by `extern "C" {' '}'.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4225&database=gcc


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

* c++/4225: bad reference in an object file caused by the include method
@ 2001-09-04  8:26 abetton
  0 siblings, 0 replies; 3+ messages in thread
From: abetton @ 2001-09-04  8:26 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4225
>Category:       c++
>Synopsis:       bad reference in an object file caused by the include method
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 04 08:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Armand Betton
>Release:        gcc 3.0.1
>Organization:
>Environment:
Reading specs from /home/dsv5/packages/gcc-3.0.1/lib/gcc-lib/sparc-sun-solaris2.
7/3.0.1/specs
Configured with: /tmcenter/navis/ccpkg/data/gcc-3.0.1/configure --prefix=/home/d
sv5/packages/gcc-3.0.1 --enable-languages=c++,java --enable-shared --enable-thre
ads --with-gnu-ld --with-ld=/home/dsv5/packages/binutils-2.11.2/bin/ld --with-gn
u-as --with-as=/home/dsv5/packages/binutils-2.11.2/bin/as
Thread model: posix
gcc version 3.0.1
>Description:
1- An .h file declaring a C++ function

/tmp/foo/foo.h

<<
void foo(int x);
>How-To-Repeat:
See description.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 >>
 
 2- A C++ source including the .h file and calling the function
 
 /tmp/foo.c
 
 <<
 #include "foo.h"
 
 int main(void)
 {
     foo(0);
 }
 >>
 
 3- First compilation using "-I" option
 
 CPLUS_INCLUDE_PATH=
 export CPLUS_INCLUDE_PATH
 gcc -ggdb -c -I/tmp/foo -o foo.o -x c++ foo.c
 nm -C foo.o
 
 <<
 0000000000000000 a *ABS*
                  U foo(int)
 0000000000000000 ? __FRAME_BEGIN__
                  U __gxx_personality_v0
 0000000000000000 T main
 >>
 
 the "foo" function is referenced as a mangled c++ function reference
 
 4- Second compilation (not using the -I option)
 
 CPLUS_INCLUDE_PATH=/tmp/foo
 export CPLUS_INCLUDE_PATH
 gcc -ggdb -c -o foo.o -x c++ foo.c
 nm -C foo.o
 
 <<
 0000000000000000 a *ABS*
 0000000000000000 ? __FRAME_BEGIN__
                  U __gxx_personality_v0
                  U foo
 0000000000000000 T main
 >>
 
 The "foo" function is now referenced as a "C" (instead of C++) function.
 
 This is a dummy example ; in a real case, the "foo" function is defined in an external library ; the "link" stage cause an "undefined reference foo(int)".
 
 
----gnatsweb-attachment----
Content-Type: application/x-gzip-compressed; name="foo.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.tgz"

H4sIAPPulDsAA+3UvW7CMBRAYa/1U1h0gQWug38GniaCVlhqkgoMQkK8OzGtYEOq1ITlfIsHW/Id
fJyb78Vn183XajhiRYITJVJ5511ZnXNVv/7yQUlcOm+Dr2Lsz1vrozIy4Ex3h32ud8aotj6m/ZNz
uRljmtG9p3b9ddh8mEl5BduJ1qnNpqlTOz12aTPTZ/3W70xlttIX/epp8d/yT/+3P2A70B2l/+if
9F/ZR//Bl/7jMtD/GErkpgResj/1kb96IAAAAAAAAAAAAAAAAPzJFes+Gw0AKAAA


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

end of thread, other threads:[~2002-11-16  2:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-21 18:56 c++/4225: bad reference in an object file caused by the include method Wolfgang Bangerth
  -- strict thread matches above, loose matches on Subject: below --
2001-09-04 15:27 aoliva
2001-09-04  8:26 abetton

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