From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joern Rennecke To: "Kaveh R. Ghazi" Cc: gdr@codesourcery.com, gcc@gcc.gnu.org Subject: Re: Silently checking whether diagnostics would occur Date: Wed, 13 Sep 2000 16:37:00 -0000 Message-id: <200009132338.AAA17109@phal.cygnus.co.uk> References: <200009131550.LAA13911@caip.rutgers.edu> X-SW-Source: 2000-09/msg00289.html > So rather than do a complete restructuring of the format checking > function, I though it would be much easier and cleaner to be able to > call the checks conceptually like this: > > > check_diagnostics_silently = 1; /* new global vars */ > > diagnostic_occurred = 0; Simpler to implement the change, but cleaner? I can see it now. Somewhere down the line, someone uses this format checking in another utility function. That function gets called by another utility function under certain circumstances. That function is then used by some piece of format-checking code. After a few month of debugging, someone figures out why certain programs just won't show any format warnings beyond some point even if there are more problems left, and invents a stack for these global variables in a static array. The array overflows for another set of programs. It is replaced with a linked list of malloced structures. Some time later, other programs are seen to cause the compiler to gobble up all available memory the memory while parsing, making the host grind to a halt, because the mallocing of structures causes a memory leak when doing error recovery. So we sprinkle a few strategically garbage collector calls into the parser. However, now some other data structures that should be live throughout the parsing stage will be freed prematurely...