preprocessor/865: -include doesn't search from "."

tor@cs.brown.edu tor@cs.brown.edu
Wed Nov 22 00:36:00 GMT 2000


>Number:         865
>Category:       preprocessor
>Synopsis:       -include doesn't search from "."
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 22 00:36:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     tor@cs.brown.edu
>Release:        gcc version 2.97 20001121 (experimental)
>Organization:
>Environment:
Linux amidala.cs.brown.edu 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown
>Description:
The "-include" option of gcc built from the tip searches
relative pathnames from the implicit directory specified
by the source file directory, and not the current 
directory.
>How-To-Repeat:
To reproduce, make sure you're using a shell that doesn't 
expand the "../" in the command line (tcsh happens to do
this).  Then follow these steps:

% touch foo.h
% echo "int i;" > foo.c
% mkdir foo
% cd foo
% gcc -v -c -include ../foo.h  ../foo.c
Reading specs from /ltmp/gfx/tor/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: /ltmp/gfx/tor/gcc/dist/configure --prefix=/ltmp/gfx/tor/gcc : (reconfigured) 
gcc version 2.97 20001121 (experimental)
 /ltmp/gfx/tor/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ -include ../foo.h ../foo.c -quiet -dumpbase foo.c -version -o /tmp/cc0YY7U9.s
GNU CPP version 2.97 20001121 (experimental) (cpplib) (i386 Linux/ELF)
GNU C version 2.97 20001121 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 2.97 20001121 (experimental).
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /ltmp/gfx/tor/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.97/include
 /ltmp/gfx/tor/gcc/i686-pc-linux-gnu/include
 /usr/include
End of search list.
../foo.c: ../foo.h: No such file or directory
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-bugs mailing list