🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #416

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

#416
From: Henry Spencer
Date: Sat, 05 Aug 1989 22:33
15 lines
1279 bytes
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
Technical Details
Message-ID: <1989Aug5.223331.4494@utzoo.uucp>
Path: arc1-ca.pugleaf.net!utzoo!henry
References: <GEOFF.89Jun11231924@onyx.cs.warwick.ac.uk| <2619@yunexus.UUCP| <388@celit.UUCP| <118@psitech.UUCP| <1063@tukki.jyu.fi| <1282@cbnewsl.ATT.COM| <617@prles2.UUCP| <220@ssp1.idca.tds.philips.nl> <594@cybaswan.UUCP> <8912@june.cs.washington.edu> <8314@boring.cwi.nl>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!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: <GEOFF.89Jun11231924@onyx.cs.warwick.ac.uk| <2619@yunexus.UUCP| <388@celit.UUCP| <118@psitech.UUCP| <1063@tukki.jyu.fi| <1282@cbnewsl.ATT.COM| <617@prles2.UUCP| <220@ssp1.idca.tds.philips.nl> <594@cybaswan.UUCP> <8912@june.cs.washington.edu> <8314@boring.cwi.nl>
Date: Sat, 5 Aug 89 22:33:31 GMT