This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cpp, CPLUS_INCLUDE_PATH, and g++: bug or feature?
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 22 Jun 2005 22:14:22 +0200
- Subject: Re: cpp, CPLUS_INCLUDE_PATH, and g++: bug or feature?
- References: <Pine.LNX.4.61.0506222145070.13159@acrux.dbai.tuwien.ac.at>
Gerald Pfeifer <gerald@pfeifer.com> writes:
| However, once I use the g++ driver to compile this program the error
| is back:
|
| % g++ x.c
| x.c:1:18: test.h: No such file or directory
|
| Which I believe contradicts the following from cppenv.texi, since even
| though we use the g++ driver, the program still is compiled as C input:
I would expect the program to be compiled as a C++ input.
| The[se] environment variables apply only when preprocessing the
| particular language indicated.
|
| Interestingly, though, the preprocessor does set __cplusplus, so it
| seems g++ preprocesses .c files as C++, but then compiles them as C.
|
| Feature, bug, or potential to improve documentation?
It must be a bug. If it process them as a C++ files, it must compile
them as C++. Similarly, if gcc preprocess files as C files, one would
expect it to compile it as C programs with appropriate semantics.
Otherwise it would lead to inconsistent semantics that the
preprocessor processes as language X and the front-end processes as
language Y.
-- Gaby