Red Hat Bugzilla – Bug 71227
cpp tries to include directories
Last modified: 2008-05-01 11:38:03 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513
Description of problem:
If there is a directory in the include path named the same way as an
include-file, the directory will be tried to be included.
If there exists a directory bar which contains the file bar and in your c-file
you have the directive
If you now try to compile with the command
g++ -I. -Ibar
cpp0 will find the _directory_ bar and give up without including the _file_ bar/bar
Version-Release number of selected component (if applicable):
Steps to Reproduce:
create a file bar/bar
now create a file foo.cc which contains the line
g++ -I. -Ibar foo.cc
Actual Results: g++ -Wall -I. -Ibar foo.cc
foo.cc:1:15: bar is a directory
Expected Results: I would like the directory to just be skipped (since I can't
be included anyway) and that the file bar/bar would be included instead.
I haven't checked the standard but this is how aCC on HP-UX does...
Created attachment 69886 [details]
Here is a patch against cpp-2.96-112 that fixes the problem
Created attachment 69904 [details]
This is of course how the patch should be... Sorry...
Seems to work with gcc-3.2-7
An errata has been issued which should help the problem described in this bug report.
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen
this bug report if the solution does not work for you.