Bug 71227 - cpp tries to include directories
cpp tries to include directories
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: cpp (Show other bugs)
7.3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-08-10 13:21 EDT by David Juran
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-08-11 05:23:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Here is a patch against cpp-2.96-112 that fixes the problem (1.05 KB, patch)
2002-08-10 19:30 EDT, David Juran
no flags Details | Diff
This is of course how the patch should be... Sorry... (1.05 KB, patch)
2002-08-11 05:23 EDT, David Juran
no flags Details | Diff

  None (edit)
Description David Juran 2002-08-10 13:21:22 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 
#include <bar>

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):


How reproducible:
Always

Steps to Reproduce:
create a file bar/bar

now create a file foo.cc which contains the line
#include <bar>

run 
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.

Additional info:

I haven't checked the standard but this is how aCC on HP-UX does...
Comment 1 David Juran 2002-08-10 19:30:15 EDT
Created attachment 69886 [details]
Here is a patch against cpp-2.96-112 that fixes the problem
Comment 2 David Juran 2002-08-11 05:23:31 EDT
Created attachment 69904 [details]
This is of course how the patch should be... Sorry...
Comment 3 David Juran 2002-10-23 16:30:24 EDT
Seems to work with gcc-3.2-7
Comment 4 Jakub Jelinek 2002-11-11 14:21:58 EST
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.

http://rhn.redhat.com/errata/RHBA-2002-200.html

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