This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7861: Finds executables instead of standard headers?
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Paul <paulf dot johnson at ukonline dot co dot uk>
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, paulf dot johnson at ukonline dot co dot uk?Subject
- Date: Sun, 23 Feb 2003 14:06:31 -0800
- Subject: Re: c++/7861: Finds executables instead of standard headers?
- References: <3E5943C7.2000205@ukonline.co.uk>
Paul <paulf dot johnson at ukonline dot co dot uk> writes:
> g++ test.cpp -o string
> Compiles fine.
>
> Change "Paul" to "Phil" (say), recompile and watch the fireworks!
Unable to reproduce this -
$ cat > test.cc
#include <string>
#include <iostream>
using namespace std;
int main()
{
string hi = "Paul";
cout << "Hello " << hi << endl;
}
$ g++ test.cc -o string ; echo $?
0
$ g++ test.cc -o string ; echo $?
0
I suspect you neglected to mention that you had -I. on your command
line, which is specifically asking for fireworks under these
conditions.
It would be sensible for cpplib to detect '\177ELF' at the beginning
of a file and abandon processing it, so as to avoid flooding the
user's terminal with unhelpful error messages. (That string cannot
appear at the beginning of a well-formed C/C++ source file.) But it
would still be an error.
zw