🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #348

Re: M2/C discussion (Re: Can you nest subroutines in C?)

#348
From: Marco Papa
Date: Wed, 05 Jul 1989 07:16
30 lines
2111 bytes
In article <8673@pyr.gatech.EDU> dsking@pyr.UUCP ( David King) writes:
>In article <18213@usc.edu> papa@pollux.usc.edu (Marco Papa) writes:
>>Does M2 provide setjmp/longjmp in one of the libraries?
					       ^^^^^^^^^
>	setjmp/longjmp?  Its definately not part of the language definition
>(they actually aren't part of C's definition unless the ANSI committee added 
>it in the last year), 

Maybe you should read more closely next time:-) I said 'libraries', not 
whether they are part of the language definition. Practically every C 
compiler that I have seen provides them, whether it runs under UNIX or 
other operating systems (PC-DOS, AmigaDOS, etc...).

>and I couldn't find anything like it in M2Sprint's 
>definitions.  *jmp actually are library routines on UNIX that got used in 
>programs so much that they made it into most C systems.  This brings up 
>something I've been wondering - what are things like *jmp useful for in an 
>Amiga program?

They are the easiest way to get out of an "error" or "abort" situation in 
one quick shot without having to add error checks on returns from functions
everywhere.  For example most ZMODEM and Kermit implementations have a single
'setjmp' at the start of the transfer which is then reached with a 'longjmp'
in case of an abort/error condition.

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
"There's Alpha, Beta, Gamma, Diga and Caligari!" -- Rick Unland
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID: <18259@usc.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!pollux.usc.edu!papa
References: <4524@crash.cts.com> <18213@usc.edu> <8673@pyr.gatech.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!pollux.usc.edu!papa
From: papa@pollux.usc.edu (Marco Papa)
Newsgroups: comp.sys.amiga.tech
Subject: Re: M2/C discussion (Re: Can you nest subroutines in C?)
Message-ID: <18259@usc.edu>
Date: 5 Jul 89 07:16:32 GMT
References: <4524@crash.cts.com> <18213@usc.edu> <8673@pyr.gatech.EDU>
Sender: news@usc.edu
Reply-To: papa@pollux.usc.edu (Marco Papa)
Organization: Felsina Software, Los Angeles, CA
Lines: 30