public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: cholm@fys.ku.dk
To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: preprocessor/5940: CPP problem when header has same name as dir in previously in search path
Date: Wed, 13 Mar 2002 10:56:00 -0000	[thread overview]
Message-ID: <20020313185515.716E74BA10@sx.fys.ku.dk> (raw)


>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 <stdio.h>
		
		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:


             reply	other threads:[~2002-03-13 18:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-13 10:56 cholm [this message]
2002-03-13 15:03 neil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020313185515.716E74BA10@sx.fys.ku.dk \
    --to=cholm@fys.ku.dk \
    --cc=debian-gcc@lists.debian.org \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).