Error Return (was Re: (char *)(-1))

Henry Spencer henry at utzoo.uucp
Sun Aug 6 08:33:31 AEST 1989


In article <8314 at boring.cwi.nl> siebren at piring.cwi.nl (Siebren van der Zee) writes:
>>[errval(foo())]
>Ok, and now the hard part: what should the code from the
>CALLED function look like?

The obvious thing to do is to have two different kinds of "return" statement,
one for normal and one for errors.  That completely hides how the "error"
flag is passed back.  Unfortunately, it is awkward on some machines, where
there are no condition codes.

Interested parties, note:  the idea is *guaranteed* to go nowhere unless
you are interested enough to implement it in a compiler.
-- 
1961-1969: 8 years of Apollo.  |     Henry Spencer at U of Toronto Zoology
1969-1989: 20 years of nothing.| uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.std.c mailing list