What is the setjump call

Henry Spencer henry at utzoo.UUCP
Tue Oct 16 02:58:18 AEST 1984


> Actually, the fact that longjmp works with one argument is not an
> accident.  The SVR2 manual page for setjmp states, "If longjmp is
> invoked with a second argument of 0, setjmp will return 1."  This
> was done to make the two argument version of setjmp backward com-
> patable with the one argument version.

It's still an accident.  Calling a function (e.g. longjmp) with fewer
parameters than expected is **NOT** guaranteed to make the missing
parameters look like zeros.  This may work on some machines, but it
is not portable.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list