Silently checking whether diagnostics would occur
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Thu Sep 14 07:43:00 GMT 2000
> From: Joern Rennecke <amylaar@cygnus.co.uk>
>
> > 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...
Okay, you've convinced me. :-)
I'll do it another way.
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Qwest Internet Solutions
More information about the Gcc
mailing list