This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 139119 - g++ fails when using specially constructed -I flag
g++ fails when using specially constructed -I flag
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
3
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-12 19:15 EST by Alejandro Mota
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-13 04:36:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Error output from failed compilation. (5.29 KB, text/plain)
2004-11-12 19:16 EST, Alejandro Mota
no flags Details

  None (edit)
Description Alejandro Mota 2004-11-12 19:15:15 EST
Description of problem:

g++ fails to compile STL headers in trivial code when the -I flag is
used to include a file named debug/debug.h

Version-Release number of selected component (if applicable):

gcc-3.4.2-6.fc3

How reproducible:

always

Steps to Reproduce:

1. Create trivial C++ program, e.g. x.cc:

#include <iostream>
int main(int ac, char* av[]) {
  return 0;
}

2. Create spurious debug.h file:

mkdir debug; cd debug; echo "" > debug.h; cd ..

3. g++ -I. x.cc

The contents of the debug.h file and its location is irrelevant, as
long as it resides in a directory called debug. 

Actual results:

Compilation failed with errors within STL headers.

Expected results:

Normal compilation.

Additional info:
Comment 1 Alejandro Mota 2004-11-12 19:16:26 EST
Created attachment 106627 [details]
Error output from failed compilation.
Comment 2 Jakub Jelinek 2004-11-13 04:36:30 EST
Eh, you of course cannot override any of the standard headers or headers they
are using, otherwise the behaviour is undefined.
If you say mkdir bits; echo > bits/types.h and use -I., nothing will compile
either.  Read the standards on what they say about this case.
Comment 3 Alejandro Mota 2004-11-13 04:45:59 EST
OK. I didn't realize that the standard headers would be overriden in
this way, since it didn't happen with previous versions of GCC (at
least in the code I compile). Thanks.

Note You need to log in before you can comment on or make changes to this bug.