[gnu.gcc.bug] Gnu preprocessor should flag deep includes

riedl@cs.purdue.EDU (John T Riedl) (10/10/89)

When I feed the Gnu preprocessor files that cause arbitrarily deep
nesting of #include, it starts telling me that it can't find subsequent
#includes, but doesn't explain that the nesting is too deep.  An
improved error message will save time in the future.

Example:  try the following files:

--------t.c-------
#include "t.h"
#include "t2.h"
---------t.h-------
#include "t1.h"
--------t1.h-----
#include "t.h"
--------t2.h-----
-------the end-------

gcc's error message on a sequent is no help in finding the problem:
-------------
[ medusa : riedl ] gcc-1.36 -v t.c
gcc version 1.36
 /usr/local/gnu/lib/gcc-1.36.lib/gcc-cpp -v -undef -D__GNUC__ -Dunix -Di386 -Dsequent -D__unix__ -D__i386__ -D__sequent__ t.c /usr/tmp/cc029941.cpp
GNU CPP version 1.36
t1.h:1: t.h: No such file or directory
--------------
gcc on a Sun 3/50 does a little better:
-------------
[ raid2 : riedl ] gcc-1.36 -v t.c
gcc version 1.36
 /usr/local/gnu/lib/gcc-1.36.lib/gcc-cpp -v -undef -D__GNUC__ -Dmc68000 -Dsun -D unix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 t.c /usr/tmp/
cca10249.cpp
GNU CPP version 1.36
t1.h:1: t.h: Too many open files
[ raid2 : riedl ]
-----------

cc produces a much better message:
-------------
[ medusa : riedl ] cc -v t.c
cpp t.c /tmp/ctm0623981059001674 
./t.h: line 2: Unreasonable include nesting
rm -f /tmp/ctm0623981059001673 /tmp/ctm0623981059001674 
-----------

Please respond via mail, since I don't usually read this list.

Thanks!
John