Bug 71227 - cpp tries to include directories
Summary: cpp tries to include directories
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: cpp   
(Show other bugs)
Version: 7.3
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-10 17:21 UTC by David Juran
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-08-11 09:23:36 UTC
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 23:30 UTC, David Juran
no flags Details | Diff
This is of course how the patch should be... Sorry... (1.05 KB, patch)
2002-08-11 09:23 UTC, David Juran
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2002:200 high SHIPPED_LIVE Updated version of GCC 2.96-RH now available 2002-09-12 04:00:00 UTC

Description David Juran 2002-08-10 17:21:22 UTC
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 23:30:15 UTC
Created attachment 69886 [details]
Here is a patch against cpp-2.96-112 that fixes the problem

Comment 2 David Juran 2002-08-11 09:23:31 UTC
Created attachment 69904 [details]
This is of course how the patch should be... Sorry...

Comment 3 David Juran 2002-10-23 20:30:24 UTC
Seems to work with gcc-3.2-7

Comment 4 Jakub Jelinek 2002-11-11 19:21:58 UTC
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.