This is the mail archive of the
mailing list for the GCC project.
Re: Silently checking whether diagnostics would occur
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Silently checking whether diagnostics would occur
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Thu, 14 Sep 2000 00:38:09 +0100 (BST)
- CC: gdr at codesourcery dot com, gcc at gcc dot gnu dot org
> 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
However, now some other data structures that should be live throughout the
parsing stage will be freed prematurely...