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

David Keppel pardo at june.cs.washington.edu
Sat Aug 5 03:09:21 AEST 1989


iiitsh at cybaswan.UUCP (Steve Hosgood) writes:
>[errval(foo())]

Until it is `prior art', it probably doesn't belong in dpANS C.

Often, `-1' is used as a return value for things that can be array
indicies, because `-1' can't be an array index.  Having `errval'
requires that you know not just the return type, but also which kinds
of values are going to be meaningful (since, e.g., not all compilers
have condition codes).  To do this `right', you need a stronger typing
system than C provides.

	;-D on  ( Stronger types, with 40% more resolving power! )  Pardo
-- 
		    pardo at cs.washington.edu
    {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo



More information about the Comp.std.c mailing list