c++/7602: C++ header files found in CPLUS_INCLUDE_PATH treated as C headers

Neil Booth neil@daikokuya.co.uk
Thu Aug 15 03:36:00 GMT 2002


The following reply was made to PR preprocessor/7602; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: s.perkins@lanl.gov
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7602: C++ header files found in CPLUS_INCLUDE_PATH treated as C headers
Date: Thu, 15 Aug 2002 08:02:11 +0100

 s.perkins@lanl.gov wrote:-
 
 > The example given below uses these two files:
 > 
 > foo.h:
 > -----------------------------------------
 > // Dummy overloaded prototypes
 > 
 > void foo(int x);
 > void foo(double x);
 > -----------------------------------------
 > 
 > 
 > and foo.cc:
 > -----------------------------------------
 > #include "foo.h"
 > 
 > int main() {
 >   main();
 > }
 > -----------------------------------------
 
 Hi,
 
 If I have foo.C in /tmp, foo.h in /tmp/foo and do the following on
 Linux:
 
 CPLUS_INCLUDE_PATH=/tmp/foo g++ /tmp/foo.C -E
 
 I get:
 
 # 1 "/tmp/foo.C"
 # 1 "<built-in>"
 # 1 "<command line>"
 # 1 "/tmp/foo.C"
 # 1 "/tmp/foo/foo.h" 1 3 4
 void foo(int x);
 void foo(double x);
 # 2 "/tmp/foo.C" 2
 
 int main() {
   main();
   }
 
 Can you please tell me what you get on Solaris, and which version
 of GCC it is.
 
 Neil.



More information about the Gcc-prs mailing list