This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to prevent runaway error messages with -pipe.


Hi Jeff,

:   >   What do you think of the following patch ?  It forces cpp to fail if 
:   >   it detects too much recusion when its output is connected to a pipe.
:   >   Without this patch the following source code:
:   > 
:   >     #include "this_file.c"
:   >     int main (void) { return 0; }
:   > 
:   >   will produce a humoungous amount of error messages when compiled
:   >   with:
: Why not make this always a fatal error?
: 
: It's kind of silly to have pipe and normal compiles behave differently.

And here is a revised patch....

May I apply this one ?

Cheers
	Nick


Tue Sep  7 18:21:13 1999  Nick Clifton  <nickc@cygnus.com>

	* cccp.c (CHECK_DEPTH): Call fatal if too much recursion is
	detected, since otherwise huge numbers of error messages can
	be generated, especially if -pipe has been used.

Index: gcc/cccp.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cccp.c,v
retrieving revision 1.73
diff -p -w -r1.73 cccp.c
*** cccp.c	1999/09/07 05:47:32	1.73
--- cccp.c	1999/09/08 08:52:37
*************** static int indepth = -1;
*** 338,343 ****
--- 338,344 ----
      {			 						\
        error_with_line (line_for_error (instack[indepth].lineno),	\
  		       "macro or `#include' recursion too deep");	\
+       fatal ("execution terminated to prevent excessive error messages");\
        code;								\
      }
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]