GNU bug report logs -
#12446
port better to POSIX hosts lacking _setjmp
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Fri, 14 Sep 2012 19:47:01 UTC
Severity: normal
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
> Date: Fri, 14 Sep 2012 12:44:37 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: Eli Zaretskii <eliz <at> gnu.org>, Juanma Barranquero <lekktu <at> gmail.com>
>
> + Port better to POSIX hosts lacking _setjmp.
> + * lisp.h: Include <setjmp.h> here, since we use its symbols here.
> + All instances of '#include <setjmp.h>' removed, if the
> + only reason for the instance was because "lisp.h" was included.
> + (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
> + Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
> + and _longjmp with the new symbols. This ports better to POSIX hosts
> + that have sigsetjmp but not _setjmp, such as some versions of
> + Solaris and Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
> + * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
> + (png_load_body) [HAVE_PNG]:
> + (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
> + (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
> + Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
> + since PNG requires jmp_buf. This is the only exception to the
> + general rule that we now use sys_setjmp and sys_longjmp.
> + This exception is OK since this code does not change the signal
> + mask or longjmp out of a signal handler.
I don't understand the rationale. Why not simply switch to using
ANSI- and Posix-standard setjmp/longjmp? You are not using the
signal-mask preserving feature of sigsetjmp, so what's the point of
using it in preference to setjmp?
This bug report was last modified 12 years and 255 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.