cpp (2.96) search path bug.

Sergei Organov osv@javad.ru
Tue Jun 13 09:57:00 GMT 2000


Hello,

Attached file contains simple directory structure that allows to reproduce the 
bug. With cpp-2.95.2 the output of the included 'tst' script is:

osv@osv$ ./tst
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000220 (Debian GNU/Linux)
 /usr/lib/gcc-lib/i386-linux/2.95.2/cpp -lang-c -nostdinc -v -Ia -Ib -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -H -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ foo.c -o /dev/null
GNU CPP version 2.95.2 20000220 (Debian GNU/Linux) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 a
 b
End of search list.
The following default directories have been omitted from the search path:
 /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../include/g++-3
 /usr/local/include
 /usr/lib/gcc-lib/i386-linux/2.95.2/../../../../i386-linux/include
 /usr/lib/gcc-lib/i386-linux/2.95.2/include
 /usr/include
End of omitted list.
a/foo.h
 b/foo.h
  b/file.h
   a/foo.h
osv@osv$

With the latest snapshot from anon cvs it results in infinite recursion,
because cpp includes 'b/foo.h' instead of 'a/foo.h' as 4-th include file.
Here is an example output:

osv@osv$ ~/build/ppc-rtems/gcc-try/gcc/cpp -lang-c -nostdinc -Ia -Ib -H -v foo.c foo.i
GNU CPP version 2.96 20000612 (experimental) (cpplib)
 (PowerPC Embedded)
#include "..." search starts here:
#include <...> search starts here:
 a
 b
End of search list.
 a/foo.h
. b/foo.h
.. b/file.h
... b/foo.h
.... b/file.h
..... b/foo.h
[...]
In file included from b/file.h:2,
[...]
                 from b/foo.h:1,
                 from b/file.h:2,
                 from b/foo.h:1,
                 from a/foo.h:2,
                 from foo.c:1:
b/foo.h:1:17: macro or `#include' recursion too deep
osv@osv$   


BR,
Sergei.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpp-bug.tgz
Type: application/x-gzip
Size: 384 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000613/e84b8ca9/attachment.bin>


More information about the Gcc-bugs mailing list