Portable uses of jmpbuf's

Karl Heuer karl at haddock.ima.isc.com
Thu Oct 13 06:07:22 AEST 1988


In article <4700023 at m.cs.uiuc.edu> wsmith at m.cs.uiuc.edu writes:
>I have heard that one fix is to wait for an ANSI compatible compiler which
>will allow "function(&a_jmpbuf);" and "function(jmpbuf * a);" in either case.

If you get an ANSI implementation, it will have an ANSI compatible setjmp() as
well, in which case jmp_buf will always be an array type.

In the meantime, I suggest you "fix" any implementation that gets this wrong
by changing <setjmp.h> to use an array type.  (You can always use an array of
size one, which contains the struct.)  If you can't modify <setjmp.h>, then
copy it and always include your modified copy.

ron at ron.rutgers.edu (Ron Natalie) writes:
>An extra ampersand doesn't hurt an array definition.

Yes it does.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list