Bug 139119 - g++ fails when using specially constructed -I flag
Summary: g++ fails when using specially constructed -I flag
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 3
Hardware: i686
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-13 00:15 UTC by Alejandro Mota
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-11-13 09:36:30 UTC
Type: ---
Embargoed:


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

Description Alejandro Mota 2004-11-13 00:15:15 UTC
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-13 00:16:26 UTC
Created attachment 106627 [details]
Error output from failed compilation.

Comment 2 Jakub Jelinek 2004-11-13 09:36:30 UTC
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 09:45:59 UTC
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.