This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with a unified error-handling API
- To: Zack Weinberg <zack at rabi dot columbia dot edu>
- Subject: Re: Problems with a unified error-handling API
- From: Jeffrey A Law <law at upchuck dot cygnus dot com>
- Date: Wed, 07 Apr 1999 03:43:46 -0600
- cc: egcs at egcs dot cygnus dot com, craig at jcb-sc dot com
- Reply-To: law at cygnus dot com
In message <199904061954.PAA14210@blastula.phys.columbia.edu>you write:
> The killer, however, is the side effects. How exactly is error()
> supposed to prevent output? It could set a global flag - fine, but
> that flag is named differently in different programs, and might not
> even exist. In cpplib, for example, there are no globals, only a
> `reader' structure that's passed to every function. You could pass a
> pointer to the flag in the wrapper function, but that's just as much
> work as doing it yourself, except you're less likely to forget.
I'd prefer to avoid the global variable. Having an extra arg for state set
by the error handlers isn't too bad.
However, don't forget that we'd like other languages we don't control
(particularly pascal & ada) to be able to plug in with minimal work, so
we don't want to change things too radically unless there is a major upside.
jeff