🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #697

Gnu preprocessor should flag deep includes

#697
From: John T Riedl
Date: Tue, 10 Oct 1989 00:11
48 lines
1974 bytes
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
Technical Details
Message-ID: <RIEDL.89Oct9191117@medusa.cs.purdue.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!purdue!riedl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!purdue!riedl
From: riedl@cs.purdue.EDU (John T Riedl)
Newsgroups: gnu.gcc.bug
Subject: Gnu preprocessor should flag deep includes
Message-ID: <RIEDL.89Oct9191117@medusa.cs.purdue.EDU>
Date: 10 Oct 89 00:11:17 GMT
Sender: riedl@cs.purdue.EDU
Distribution: gnu
Organization: Department of Computer Science, Purdue University
Lines: 48