🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #417

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

#417
From: david Fridley
Date: Sat, 05 Aug 1989 20:41
24 lines
1475 bytes
variable,  which makes the function not reenterant or relocateable. (Unless
you have the hardware and CPU power to support virtual memory and tasking.)

The problem with #define errval(x) if(x<0) is that in many systems the stack
is around the top of memory, and therefore many stack variables would be
negative.

The MAGIC_1 idea seems good, you are just trying to identify values that 
pointer can not have.  If we use #defines for thes values and put them in
errno.h then the function will be common across systems even if the values
are not.

Wouldn't it be nice if you could return more than one value from a C function?
ie:
	(ret1,ret2)=func(param1,param2,param3);
I believe this would solve are error problems, and many others that I have had.



-- 
david.
DISCLAIMER: If it's important have a backup.  If it ain't broke don't fix it.
Proceed at your own risk.  My oponions are MY own.  Spelling does not count.
My fondest dream is to leave this planet.
Technical Details
Message-ID: <123@psitech.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!psitech!david
References: <GEOFF.89Jun11231924@onyx.cs.warwick.ac.uk| <2619@yunexus.UUCP| <26998@agate.BERKELEY.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!psitech!david
From: david@psitech.UUCP (david Fridley)
Newsgroups: comp.std.c
Subject: Re: Error Return (was Re: (char *)(-1))
Summary: Embedded Systems
Keywords: error, flag, exception
Message-ID: <123@psitech.UUCP>
Date: 5 Aug 89 20:41:45 GMT
References: <GEOFF.89Jun11231924@onyx.cs.warwick.ac.uk| <2619@yunexus.UUCP| <26998@agate.BERKELEY.EDU>
Organization: PsiTech Inc., Fountain Valley, CA
Lines: 24