From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21771 invoked by alias); 13 Mar 2002 18:56:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21733 invoked by uid 71); 13 Mar 2002 18:56:01 -0000 Resent-Date: 13 Mar 2002 18:56:01 -0000 Resent-Message-ID: <20020313185601.21732.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, cholm@fys.ku.dk Received:(qmail 20204 invoked from network); 13 Mar 2002 18:55:16 -0000 Received: from unknown (HELO kirstine.fys.ku.dk) (130.225.102.150) by sources.redhat.com with SMTP; 13 Mar 2002 18:55:16 -0000 Received: from sx.fys.ku.dk (scharff.fys.ku.dk [130.225.102.66]) by kirstine.fys.ku.dk (Postfix) with ESMTP id 096CE185A9; Wed, 13 Mar 2002 19:55:16 +0100 (CET) Received: by sx.fys.ku.dk (Postfix, from userid 861) id 716E74BA10; Wed, 13 Mar 2002 19:55:15 +0100 (CET) Message-Id:<20020313185515.716E74BA10@sx.fys.ku.dk> Date: Wed, 13 Mar 2002 10:56:00 -0000 From: cholm@fys.ku.dk To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version:3.113 Subject: preprocessor/5940: CPP problem when header has same name as dir in previously in search path X-SW-Source: 2002-03/txt/msg00435.txt.bz2 List-Id: >Number: 5940 >Category: preprocessor >Synopsis: CPP problem when header has same name as dir in previously in search path >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Mar 13 10:56:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Christian Holm Christensen >Release: 3.0.3 (Debian testing/unstable) >Organization: >Environment: System: Linux scharff.fys.ku.dk 2.2.17 #2 SMP Tue Nov 14 17:20:25 CET 2000 i686 unknown Architecture: i686 host: i386-pc-linux-gnu build: i386-pc-linux-gnu target: i386-pc-linux-gnu configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux >Description: If an `#include' directive, wether it a "..." or a <...> which matches a directory name in the search path, will make CPP try to include that directory, regardless of wether there's an actual file later on in the search. This problem is present in EGCS 2.91.66, GCC 2.93.4, `GCC 2.96-RH', and GCC 3.0.3. It may be that I'm doing things wrong, but I do believe the interface is rather contra-intutive in that case. I did not find anything in the documentation that could help me on this. >How-To-Repeat: Make the directory `stdio.h': prompt% mkdir -p stdio.h Make a file (say foo.c) in the current directory, with the contenst: #include int main() { printf("Hello World\n"); return 0; } Try to compile this as prompt% gcc -c -I. foo.c It will fail with: foo.c:1: directory `stdio.h' specified in #include I know that `stdio.h' is not a common name for a directory, but imagine something like `new' in C++ code. >Fix: If one uses `-idirafter .' rather then `-I.', then everything works fine. >Release-Note: >Audit-Trail: >Unformatted: