This is the mail archive of the 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: Silently checking whether diagnostics would occur

> 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...

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