expr?(void):(void)

Henry Spencer henry at utzoo.UUCP
Sat Aug 9 06:39:40 AEST 1986


> we are working on a stdio-like library at waterloo which looks very
> similar to this.  Checking the value returned by putchar() every
> single time can be quite a waste...
> The solution we use is to have the _WriteBuf function, instead of
> returning an indication of error, either print the message and
> exit itself, or "raise an event" that can be trapped in the user's
> code (signals or longjumps).  [This wins big.]

On the whole I think this an excellent idea... but Ray, is it too late
to convince the people involved *not* to use signals for communications?
This has long been recognized as a bad idea.  And it's so unnecessary
in this case, and related ones:  it suffices to say that whenever the
_WriteBuf function fails, it calls (say) _WBerror with some suitable
parameters, and the user can substitute his own _WBerror function if he
doesn't like the default one.  This gets much of the benefit without
the various problems and unportabilities of signals.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,decvax,pyramid}!utzoo!henry



More information about the Comp.lang.c mailing list