Newsgroups: comp.std.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Error Return (was Re: (char *)(-1)) Message-ID: <1989Aug5.223331.4494@utzoo.uucp> Organization: U of Toronto Zoology References: <594@cybaswan.UUCP> <8912@june.cs.washington.edu> <8314@boring.cwi.nl> Date: Sat, 5 Aug 89 22:33:31 GMT In article <8314@boring.cwi.nl> siebren@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@zoo.toronto.edu