From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Sep 2012 19:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 12446@debbugs.gnu.org Cc: Juanma Barranquero , Eli Zaretskii X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13476519828335 (code B ref -1); Fri, 14 Sep 2012 19:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Sep 2012 19:46:22 +0000 Received: from localhost ([127.0.0.1]:34205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCbqF-0002AL-HT for submit@debbugs.gnu.org; Fri, 14 Sep 2012 15:46:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36889) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCbq9-0002AA-Ou for submit@debbugs.gnu.org; Fri, 14 Sep 2012 15:46:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCbp2-0008DT-Ru for submit@debbugs.gnu.org; Fri, 14 Sep 2012 15:45:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:34317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCbp2-0008D0-Od for submit@debbugs.gnu.org; Fri, 14 Sep 2012 15:45:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCbot-0005ko-MT for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 15:45:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCbon-0007zy-GC for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 15:44:55 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:40494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCbom-0007xz-S1; Fri, 14 Sep 2012 15:44:49 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 9347D39E8008; Fri, 14 Sep 2012 12:44:40 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XxHdeW-9SSRM; Fri, 14 Sep 2012 12:44:37 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 746D139E800E; Fri, 14 Sep 2012 12:44:37 -0700 (PDT) Message-ID: <50538925.3010608@cs.ucla.edu> Date: Fri, 14 Sep 2012 12:44:37 -0700 From: Paul Eggert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Tags: patch Here's a patch I plan to install after a bit more testing. It affects the use of setjmp / _setjmp and so the Windows port probably needs to be updated (for the symbols HAVE__SETJMP and/or HAVE_SIGSETJMP). I don't think it breaks anything in Windows but have not looked at the Windows port closely and I could be mistaken. I'm CC'ing this to Eli and Juanma as a heads-up. === modified file 'ChangeLog' --- ChangeLog 2012-09-14 18:56:19 +0000 +++ ChangeLog 2012-09-14 19:35:57 +0000 @@ -1,5 +1,9 @@ 2012-09-14 Paul Eggert + Port better to POSIX hosts lacking _setjmp. + * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols. + (_setjmp, _longjmp): Remove. + * configure.ac: Port to hosts lacking gtk. (PKG_CHECK_MODULES): Capture pkg-config diagnostics better, in particular, problems in invoking pkg-config itself. === modified file 'configure.ac' --- configure.ac 2012-09-14 18:56:19 +0000 +++ configure.ac 2012-09-14 19:35:57 +0000 @@ -3774,13 +3774,24 @@ _longjmp (j, 1);]])], [emacs_cv_func__setjmp=yes], [emacs_cv_func__setjmp=no])]) -if test $emacs_cv_func__setjmp = no; then - AC_DEFINE([_setjmp], [setjmp], - [Define to setjmp if _setjmp and _longjmp do not work. See _longjmp.]) - AC_DEFINE([_longjmp], [longjmp], - [Define to longjmp if _setjmp and _longjmp do not work. - Because longjmp may alter signal masks, callers of _longjmp - should not assume that it leaves signal masks alone.]) +if test $emacs_cv_func__setjmp = yes; then + AC_DEFINE([HAVE__SETJMP], 1, [Define to 1 if _setjmp and _longjmp work.]) +else + AC_CACHE_CHECK([for sigsetjmp], [emacs_cv_func_sigsetjmp], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[sigjmp_buf j; + if (! sigsetjmp (j, 1)) + siglongjmp (j, 1);]])], + [emacs_cv_func_sigsetjmp=yes], + [emacs_cv_func_sigsetjmp=no])]) + if test $emacs_cv_func_sigsetjmp = yes; then + AC_DEFINE([HAVE_SIGSETJMP], 1, + [Define to 1 if sigsetjmp and siglongjmp work. + The value of this symbol is irrelevant if HAVE__SETJMP is defined.]) + fi fi case $opsys in === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-14 14:23:50 +0000 +++ src/ChangeLog 2012-09-14 19:35:57 +0000 @@ -1,3 +1,24 @@ +2012-09-14 Paul Eggert + + Port better to POSIX hosts lacking _setjmp. + * lisp.h: Include here, since we use its symbols here. + All instances of '#include ' 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. + 2012-09-14 Dmitry Antipov Avoid out-of-range marker position (Bug#12426). === modified file 'src/alloc.c' --- src/alloc.c 2012-09-13 05:18:26 +0000 +++ src/alloc.c 2012-09-14 19:35:57 +0000 @@ -24,7 +24,6 @@ #include #include /* For CHAR_BIT. */ -#include #ifdef ENABLE_CHECKING #include /* For SIGABRT. */ @@ -45,7 +44,7 @@ #include "frame.h" #include "blockinput.h" #include "termhooks.h" /* For struct terminal. */ -#include + #include /* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects. @@ -4762,14 +4761,14 @@ { char buf[10]; register int x; - jmp_buf jbuf; + sys_jmp_buf jbuf; /* Arrange for X to be put in a register. */ sprintf (buf, "1"); x = strlen (buf); x = 2 * x - 1; - _setjmp (jbuf); + sys_setjmp (jbuf); if (longjmps_done == 1) { /* Came here after the longjmp at the end of the function. @@ -4794,7 +4793,7 @@ ++longjmps_done; x = 2; if (longjmps_done == 1) - _longjmp (jbuf, 1); + sys_longjmp (jbuf, 1); } #endif /* not GC_SAVE_REGISTERS_ON_STACK && not GC_SETJMP_WORKS */ @@ -4900,7 +4899,7 @@ /* jmp_buf may not be aligned enough on darwin-ppc64 */ union aligned_jmpbuf { Lisp_Object o; - jmp_buf j; + sys_jmp_buf j; } j; volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base; #endif @@ -4936,7 +4935,7 @@ } #endif /* GC_SETJMP_WORKS */ - _setjmp (j.j); + sys_setjmp (j.j); end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; #endif /* not GC_SAVE_REGISTERS_ON_STACK */ #endif /* not HAVE___BUILTIN_UNWIND_INIT */ === modified file 'src/atimer.c' --- src/atimer.c 2012-09-07 01:27:44 +0000 +++ src/atimer.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,7 @@ #include #include -#include + #include "lisp.h" #include "syssignal.h" #include "systime.h" === modified file 'src/bidi.c' --- src/bidi.c 2012-09-11 22:59:50 +0000 +++ src/bidi.c 2012-09-14 19:35:57 +0000 @@ -56,7 +56,6 @@ #include #include -#include #include "lisp.h" #include "character.h" === modified file 'src/buffer.c' --- src/buffer.c 2012-09-11 04:22:03 +0000 +++ src/buffer.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #include #include #include -#include #include #include === modified file 'src/bytecode.c' --- src/bytecode.c 2012-09-04 17:34:54 +0000 +++ src/bytecode.c 2012-09-14 19:35:57 +0000 @@ -33,7 +33,7 @@ */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/callint.c' --- src/callint.c 2012-08-25 03:11:12 +0000 +++ src/callint.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include -#include #include "lisp.h" #include "character.h" === modified file 'src/callproc.c' --- src/callproc.c 2012-09-07 01:27:44 +0000 +++ src/callproc.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include === modified file 'src/casefiddle.c' --- src/casefiddle.c 2012-08-25 06:25:00 +0000 +++ src/casefiddle.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/casetab.c' --- src/casetab.c 2012-08-25 06:25:00 +0000 +++ src/casetab.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/category.c' --- src/category.c 2012-08-25 06:25:00 +0000 +++ src/category.c 2012-09-14 19:35:57 +0000 @@ -32,7 +32,6 @@ #define CATEGORY_INLINE EXTERN_INLINE -#include #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/ccl.c' --- src/ccl.c 2012-07-05 06:32:41 +0000 +++ src/ccl.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/character.c' --- src/character.c 2012-09-04 17:34:54 +0000 +++ src/character.c 2012-09-14 19:35:57 +0000 @@ -36,7 +36,6 @@ #ifdef emacs #include -#include #include #include "lisp.h" #include "character.h" === modified file 'src/charset.c' --- src/charset.c 2012-09-04 17:34:54 +0000 +++ src/charset.c 2012-09-14 19:35:57 +0000 @@ -32,7 +32,6 @@ #include #include #include -#include #include #include "lisp.h" #include "character.h" === modified file 'src/chartab.c' --- src/chartab.c 2012-08-26 08:41:36 +0000 +++ src/chartab.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "charset.h" === modified file 'src/cm.c' --- src/cm.c 2012-09-04 17:34:54 +0000 +++ src/cm.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #include #include -#include #include "lisp.h" #include "frame.h" === modified file 'src/cmds.c' --- src/cmds.c 2012-08-27 16:19:34 +0000 +++ src/cmds.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" === modified file 'src/coding.c' --- src/coding.c 2012-09-04 17:34:54 +0000 +++ src/coding.c 2012-09-14 19:35:57 +0000 @@ -285,7 +285,6 @@ #include #include -#include #include "lisp.h" #include "character.h" === modified file 'src/composite.c' --- src/composite.c 2012-08-27 17:23:48 +0000 +++ src/composite.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #define COMPOSITE_INLINE EXTERN_INLINE -#include #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/data.c' --- src/data.c 2012-09-12 19:16:36 +0000 +++ src/data.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #include #include -#include #include === modified file 'src/dbusbind.c' --- src/dbusbind.c 2012-08-27 17:23:48 +0000 +++ src/dbusbind.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,7 @@ #ifdef HAVE_DBUS #include #include -#include + #include "lisp.h" #include "frame.h" #include "termhooks.h" === modified file 'src/dired.c' --- src/dired.c 2012-09-04 17:34:54 +0000 +++ src/dired.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #include #include #include -#include #ifdef HAVE_PWD_H #include === modified file 'src/dispnew.c' --- src/dispnew.c 2012-09-13 02:21:28 +0000 +++ src/dispnew.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #define DISPEXTERN_INLINE EXTERN_INLINE #include -#include #include #include "lisp.h" === modified file 'src/doc.c' --- src/doc.c 2012-09-03 19:36:09 +0000 +++ src/doc.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #include #include /* Must be after sys/types.h for USG*/ -#include #include #include === modified file 'src/doprnt.c' --- src/doprnt.c 2012-09-09 16:06:33 +0000 +++ src/doprnt.c 2012-09-14 19:35:57 +0000 @@ -102,7 +102,6 @@ #include #include -#include #include #include #include === modified file 'src/dosfns.c' --- src/dosfns.c 2012-08-17 21:52:15 +0000 +++ src/dosfns.c 2012-09-14 19:35:57 +0000 @@ -30,7 +30,7 @@ #include #undef gettime #undef settime -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/editfns.c' --- src/editfns.c 2012-09-11 04:22:03 +0000 +++ src/editfns.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include #include -#include #ifdef HAVE_PWD_H #include === modified file 'src/emacs.c' --- src/emacs.c 2012-09-13 02:21:28 +0000 +++ src/emacs.c 2012-09-14 19:35:57 +0000 @@ -25,7 +25,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/emacsgtkfixed.c' --- src/emacsgtkfixed.c 2012-09-13 04:14:33 +0000 +++ src/emacsgtkfixed.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,7 @@ #include "emacsgtkfixed.h" #include -#include + #include "lisp.h" #include "frame.h" #include "xterm.h" === modified file 'src/eval.c' --- src/eval.c 2012-09-12 21:34:24 +0000 +++ src/eval.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include #include -#include #include #include "lisp.h" #include "blockinput.h" @@ -1072,7 +1071,7 @@ catchlist = &c; /* Call FUNC. */ - if (! _setjmp (c.jmp)) + if (! sys_setjmp (c.jmp)) c.val = (*func) (arg); /* Throw works by a longjmp that comes right here. */ @@ -1140,7 +1139,7 @@ backtrace_list = catch->backlist; lisp_eval_depth = catch->lisp_eval_depth; - _longjmp (catch->jmp, 1); + sys_longjmp (catch->jmp, 1); } DEFUN ("throw", Fthrow, Sthrow, 2, 2, 0, @@ -1246,7 +1245,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { if (!NILP (h.var)) specbind (h.var, c.val); @@ -1301,7 +1300,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1339,7 +1338,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1381,7 +1380,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1425,7 +1424,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val, nargs, args); } === modified file 'src/fileio.c' --- src/fileio.c 2012-09-05 07:18:46 +0000 +++ src/fileio.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #include #include #include -#include #include #ifdef HAVE_PWD_H === modified file 'src/filelock.c' --- src/filelock.c 2012-09-05 07:18:46 +0000 +++ src/filelock.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #include #include #include -#include #ifdef HAVE_PWD_H #include === modified file 'src/floatfns.c' --- src/floatfns.c 2012-09-11 02:28:27 +0000 +++ src/floatfns.c 2012-09-14 19:35:57 +0000 @@ -29,7 +29,7 @@ */ #include -#include + #include "lisp.h" #include "syssignal.h" === modified file 'src/fns.c' --- src/fns.c 2012-09-11 22:59:50 +0000 +++ src/fns.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include === modified file 'src/font.c' --- src/font.c 2012-09-06 08:04:49 +0000 +++ src/font.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #include #include #include -#include #include === modified file 'src/fontset.c' --- src/fontset.c 2012-09-06 08:04:49 +0000 +++ src/fontset.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #include #include -#include #include "lisp.h" #include "blockinput.h" === modified file 'src/frame.c' --- src/frame.c 2012-09-13 05:18:26 +0000 +++ src/frame.c 2012-09-14 19:35:57 +0000 @@ -24,7 +24,6 @@ #include #include #include -#include #include === modified file 'src/fringe.c' --- src/fringe.c 2012-09-09 20:10:36 +0000 +++ src/fringe.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,6 @@ #include #include -#include #include "lisp.h" #include "frame.h" === modified file 'src/ftfont.c' --- src/ftfont.c 2012-09-06 08:04:49 +0000 +++ src/ftfont.c 2012-09-14 19:35:57 +0000 @@ -21,8 +21,6 @@ #include #include -#include - #include #include === modified file 'src/ftxfont.c' --- src/ftxfont.c 2012-09-06 08:04:49 +0000 +++ src/ftxfont.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/gnutls.c' --- src/gnutls.c 2012-08-18 02:49:24 +0000 +++ src/gnutls.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,6 @@ #include #include -#include #include "lisp.h" #include "process.h" === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-09-07 01:27:44 +0000 +++ src/gtkutil.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #ifdef USE_GTK #include #include -#include #include === modified file 'src/image.c' --- src/image.c 2012-09-13 01:22:08 +0000 +++ src/image.c 2012-09-14 19:35:57 +0000 @@ -5514,6 +5514,13 @@ #endif /* HAVE_NTGUI */ +/* Possibly inefficient/inexact substitutes for _setjmp and _longjmp. + Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp + substitute may munge the signal mask, but that should be OK here. */ +#ifndef HAVE__SETJMP +# define _setjmp(j) setjmp (j) +# define _longjmp longjmp +#endif #if (PNG_LIBPNG_VER < 10500) #define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1)) @@ -5593,7 +5600,7 @@ struct png_load_context { - /* These are members so that _longjmp doesn't munge local variables. */ + /* These are members so that longjmp doesn't munge local variables. */ png_struct *png_ptr; png_info *info_ptr; png_info *end_info; @@ -6129,9 +6136,9 @@ struct my_jpeg_error_mgr { struct jpeg_error_mgr pub; - jmp_buf setjmp_buffer; + sys_jmp_buf setjmp_buffer; - /* The remaining members are so that _longjmp doesn't munge local + /* The remaining members are so that longjmp doesn't munge local variables. */ struct jpeg_decompress_struct cinfo; enum @@ -6151,7 +6158,7 @@ { struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err; mgr->failure_code = MY_JPEG_ERROR_EXIT; - _longjmp (mgr->setjmp_buffer, 1); + sys_longjmp (mgr->setjmp_buffer, 1); } @@ -6401,7 +6408,7 @@ error is detected. This function will perform a longjmp. */ mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub); mgr->pub.error_exit = my_error_exit; - if (_setjmp (mgr->setjmp_buffer)) + if (sys_setjmp (mgr->setjmp_buffer)) { switch (mgr->failure_code) { @@ -6460,14 +6467,14 @@ if (!check_image_size (f, width, height)) { mgr->failure_code = MY_JPEG_INVALID_IMAGE_SIZE; - _longjmp (mgr->setjmp_buffer, 1); + sys_longjmp (mgr->setjmp_buffer, 1); } /* Create X image and pixmap. */ if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) { mgr->failure_code = MY_JPEG_CANNOT_CREATE_X; - _longjmp (mgr->setjmp_buffer, 1); + sys_longjmp (mgr->setjmp_buffer, 1); } /* Allocate colors. When color quantization is used, === modified file 'src/indent.c' --- src/indent.c 2012-09-04 17:34:54 +0000 +++ src/indent.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include #include -#include #include "lisp.h" #include "character.h" === modified file 'src/insdel.c' --- src/insdel.c 2012-09-14 14:23:50 +0000 +++ src/insdel.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include -#include #include === modified file 'src/intervals.c' --- src/intervals.c 2012-09-04 17:34:54 +0000 +++ src/intervals.c 2012-09-14 19:35:57 +0000 @@ -41,7 +41,6 @@ #define INTERVALS_INLINE EXTERN_INLINE -#include #include #include "lisp.h" #include "intervals.h" === modified file 'src/keyboard.c' --- src/keyboard.c 2012-09-13 16:23:06 +0000 +++ src/keyboard.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,7 @@ #define KEYBOARD_INLINE EXTERN_INLINE #include -#include + #include "lisp.h" #include "termchar.h" #include "termopts.h" @@ -145,7 +145,7 @@ /* For longjmp to where kbd input is being done. */ -static jmp_buf getcjmp; +static sys_jmp_buf getcjmp; /* True while doing kbd input. */ int waiting_for_input; @@ -434,8 +434,8 @@ Lisp_Object *, ptrdiff_t); static Lisp_Object make_lispy_switch_frame (Lisp_Object); static int help_char_p (Lisp_Object); -static void save_getcjmp (jmp_buf); -static void restore_getcjmp (jmp_buf); +static void save_getcjmp (sys_jmp_buf); +static void restore_getcjmp (sys_jmp_buf); static Lisp_Object apply_modifiers (int, Lisp_Object); static void clear_event (struct input_event *); static Lisp_Object restore_kboard_configuration (Lisp_Object); @@ -2315,8 +2315,8 @@ { volatile Lisp_Object c; ptrdiff_t jmpcount; - jmp_buf local_getcjmp; - jmp_buf save_jump; + sys_jmp_buf local_getcjmp; + sys_jmp_buf save_jump; volatile int key_already_recorded = 0; Lisp_Object tem, save; volatile Lisp_Object previous_echo_area_message; @@ -2562,7 +2562,7 @@ it *must not* be in effect when we call redisplay. */ jmpcount = SPECPDL_INDEX (); - if (_setjmp (local_getcjmp)) + if (sys_setjmp (local_getcjmp)) { /* Handle quits while reading the keyboard. */ /* We must have saved the outer value of getcjmp here, @@ -3394,13 +3394,13 @@ See read_process_output. */ static void -save_getcjmp (jmp_buf temp) +save_getcjmp (sys_jmp_buf temp) { memcpy (temp, getcjmp, sizeof getcjmp); } static void -restore_getcjmp (jmp_buf temp) +restore_getcjmp (sys_jmp_buf temp) { memcpy (getcjmp, temp, sizeof getcjmp); } @@ -10979,7 +10979,7 @@ do_switch_frame (make_lispy_switch_frame (internal_last_event_frame), 0, 0, Qnil); - _longjmp (getcjmp, 1); + sys_longjmp (getcjmp, 1); } DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, === modified file 'src/keymap.c' --- src/keymap.c 2012-09-04 17:34:54 +0000 +++ src/keymap.c 2012-09-14 19:35:57 +0000 @@ -40,7 +40,7 @@ #include #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" === modified file 'src/lisp.h' --- src/lisp.h 2012-09-11 23:50:28 +0000 +++ src/lisp.h 2012-09-14 19:35:57 +0000 @@ -20,6 +20,7 @@ #ifndef EMACS_LISP_H #define EMACS_LISP_H +#include #include #include #include @@ -1963,7 +1964,24 @@ static struct Lisp_Kboard_Objfwd ko_fwd; \ defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \ } while (0) + +/* Save and restore the instruction and environment pointers, + without affecting the signal mask. */ +#ifdef HAVE__SETJMP +typedef jmp_buf sys_jmp_buf; +# define sys_setjmp(j) _setjmp (j) +# define sys_longjmp(j, v) _longjmp (j, v) +#elif defined HAVE_SIGSETJMP +typedef sigjmp_buf sys_jmp_buf; +# define sys_setjmp(j) sigsetjmp (j, 0) +# define sys_longjmp(j, v) siglongjmp (j, v) +#else +/* A non-POSIX platform; assume longjmp does not affect the sigmask. */ +typedef jmp_buf sys_jmp_buf; +# define sys_setjmp(j) setjmp (j) +# define sys_longjmp(j, v) longjmp (j, v) +#endif /* Structure for recording Lisp call stack for backtrace purposes. */ @@ -2056,7 +2074,7 @@ Lisp_Object volatile val; struct catchtag *volatile next; struct gcpro *gcpro; - jmp_buf jmp; + sys_jmp_buf jmp; struct backtrace *backlist; struct handler *handlerlist; EMACS_INT lisp_eval_depth; === modified file 'src/lread.c' --- src/lread.c 2012-09-11 04:22:03 +0000 +++ src/lread.c 2012-09-14 19:35:57 +0000 @@ -25,7 +25,6 @@ #include #include #include /* For CHAR_BIT. */ -#include #include #include "lisp.h" #include "intervals.h" === modified file 'src/macros.c' --- src/macros.c 2012-08-17 23:38:43 +0000 +++ src/macros.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ #include -#include + #include "lisp.h" #include "macros.h" #include "commands.h" === modified file 'src/marker.c' --- src/marker.c 2012-09-11 04:22:03 +0000 +++ src/marker.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,7 @@ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/menu.c' --- src/menu.c 2012-09-04 17:34:54 +0000 +++ src/menu.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #include #include -#include #include /* for INT_MAX */ #include "lisp.h" === modified file 'src/minibuf.c' --- src/minibuf.c 2012-09-11 04:22:03 +0000 +++ src/minibuf.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include #include -#include #include "lisp.h" #include "commands.h" === modified file 'src/nsfns.m' --- src/nsfns.m 2012-09-07 01:27:44 +0000 +++ src/nsfns.m 2012-09-14 19:35:57 +0000 @@ -31,7 +31,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/nsfont.m' --- src/nsfont.m 2012-09-06 08:04:49 +0000 +++ src/nsfont.m 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "dispextern.h" === modified file 'src/nsimage.m' --- src/nsimage.m 2012-08-16 21:58:44 +0000 +++ src/nsimage.m 2012-09-14 19:35:57 +0000 @@ -28,7 +28,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "dispextern.h" === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-09-04 17:34:54 +0000 +++ src/nsmenu.m 2012-09-14 19:35:57 +0000 @@ -24,7 +24,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "window.h" === modified file 'src/nsselect.m' --- src/nsselect.m 2012-08-07 13:37:21 +0000 +++ src/nsselect.m 2012-09-14 19:35:57 +0000 @@ -28,7 +28,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "nsterm.h" === modified file 'src/nsterm.m' --- src/nsterm.m 2012-09-11 17:08:02 +0000 +++ src/nsterm.m 2012-09-14 19:35:57 +0000 @@ -35,7 +35,6 @@ #include #include #include -#include #include #include === modified file 'src/print.c' --- src/print.c 2012-09-11 04:22:03 +0000 +++ src/print.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,7 @@ #include #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/process.c' --- src/process.c 2012-09-13 02:21:28 +0000 +++ src/process.c 2012-09-14 19:35:57 +0000 @@ -25,12 +25,9 @@ #include #include -#include #include /* Some typedefs are used in sys/file.h. */ #include #include -#include - #include #include @@ -5421,7 +5418,7 @@ /* Sending data to subprocess */ -static jmp_buf send_process_frame; +static sys_jmp_buf send_process_frame; static Lisp_Object process_sent_to; static _Noreturn void @@ -5431,7 +5428,7 @@ sigemptyset (&unblocked); sigaddset (&unblocked, SIGPIPE); pthread_sigmask (SIG_UNBLOCK, &unblocked, 0); - _longjmp (send_process_frame, 1); + sys_longjmp (send_process_frame, 1); } static void @@ -5640,7 +5637,7 @@ /* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2, CFLAGS="-g -O": The value of the parameter `proc' is clobbered when returning with longjmp despite being declared volatile. */ - if (!_setjmp (send_process_frame)) + if (!sys_setjmp (send_process_frame)) { p = XPROCESS (proc); /* Repair any setjmp clobbering. */ process_sent_to = proc; === modified file 'src/ralloc.c' --- src/ralloc.c 2012-09-04 17:34:54 +0000 +++ src/ralloc.c 2012-09-14 19:35:57 +0000 @@ -25,7 +25,7 @@ #ifdef emacs #include -#include + #include "lisp.h" /* Needed for VALBITS. */ #include "blockinput.h" === modified file 'src/regex.c' --- src/regex.c 2012-09-03 19:36:09 +0000 +++ src/regex.c 2012-09-14 19:35:57 +0000 @@ -126,7 +126,6 @@ that make sense only in Emacs. */ #ifdef emacs -# include # include "lisp.h" # include "character.h" # include "buffer.h" === modified file 'src/region-cache.c' --- src/region-cache.c 2012-09-04 17:34:54 +0000 +++ src/region-cache.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include "lisp.h" #include "character.h" === modified file 'src/scroll.c' --- src/scroll.c 2012-09-04 17:34:54 +0000 +++ src/scroll.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,7 @@ #include #include -#include + #include "lisp.h" #include "termchar.h" #include "dispextern.h" === modified file 'src/search.c' --- src/search.c 2012-09-04 17:34:54 +0000 +++ src/search.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,7 @@ #include -#include + #include "lisp.h" #include "syntax.h" #include "category.h" === modified file 'src/sheap.c' --- src/sheap.c 2012-01-19 07:21:25 +0000 +++ src/sheap.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,7 @@ #include #include -#include + #include "lisp.h" #include @@ -93,4 +93,3 @@ bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); message ("%s", buf); } - === modified file 'src/sound.c' --- src/sound.c 2012-09-13 02:21:28 +0000 +++ src/sound.c 2012-09-14 19:35:57 +0000 @@ -44,7 +44,7 @@ #include #include #include -#include + #include "lisp.h" #include "dispextern.h" #include "atimer.h" === modified file 'src/syntax.c' --- src/syntax.c 2012-09-08 14:23:01 +0000 +++ src/syntax.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,7 @@ #include #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" === modified file 'src/sysdep.c' --- src/sysdep.c 2012-09-13 02:21:28 +0000 +++ src/sysdep.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #include #include -#include #ifdef HAVE_PWD_H #include #include === modified file 'src/term.c' --- src/term.c 2012-09-13 02:21:28 +0000 +++ src/term.c 2012-09-14 19:35:57 +0000 @@ -25,7 +25,6 @@ #include #include #include -#include #include "lisp.h" #include "termchar.h" === modified file 'src/termcap.c' --- src/termcap.c 2012-07-05 18:35:48 +0000 +++ src/termcap.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ /* Emacs config.h may rename various library functions such as malloc. */ #include -#include #include #include #include === modified file 'src/terminal.c' --- src/terminal.c 2012-09-04 17:34:54 +0000 +++ src/terminal.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #define TERMHOOKS_INLINE EXTERN_INLINE #include -#include #include "lisp.h" #include "frame.h" === modified file 'src/terminfo.c' --- src/terminfo.c 2012-09-04 17:34:54 +0000 +++ src/terminfo.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include #include "tparam.h" -#include #include "lisp.h" /* Define these variables that serve as global parameters to termcap, === modified file 'src/textprop.c' --- src/textprop.c 2012-09-07 14:45:28 +0000 +++ src/textprop.c 2012-09-14 19:35:57 +0000 @@ -17,7 +17,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "intervals.h" #include "character.h" === modified file 'src/tparam.c' --- src/tparam.c 2012-09-04 17:34:54 +0000 +++ src/tparam.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ /* Emacs config.h may rename various library functions such as malloc. */ #include -#include + #include "lisp.h" /* for xmalloc */ #include "tparam.h" === modified file 'src/undo.c' --- src/undo.c 2012-08-28 06:20:08 +0000 +++ src/undo.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,7 @@ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/unexaix.c' --- src/unexaix.c 2012-08-19 20:02:24 +0000 +++ src/unexaix.c 2012-09-14 19:35:57 +0000 @@ -89,7 +89,6 @@ static int pagemask; -#include #include "lisp.h" static void === modified file 'src/unexcoff.c' --- src/unexcoff.c 2012-08-19 20:02:24 +0000 +++ src/unexcoff.c 2012-09-14 19:35:57 +0000 @@ -120,7 +120,6 @@ #define ADDR_CORRECT(x) ((char *)(x) - (char*)0) -#include #include "lisp.h" static void === modified file 'src/unexcw.c' --- src/unexcw.c 2012-01-19 07:21:25 +0000 +++ src/unexcw.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include "unexec.h" -#include #include #include #include === modified file 'src/unexsol.c' --- src/unexsol.c 2012-06-16 12:24:15 +0000 +++ src/unexsol.c 2012-09-14 19:35:57 +0000 @@ -4,7 +4,6 @@ #include "unexec.h" #include -#include #include "lisp.h" #include "character.h" === modified file 'src/vm-limit.c' --- src/vm-limit.c 2012-08-19 21:00:09 +0000 +++ src/vm-limit.c 2012-09-14 19:35:57 +0000 @@ -17,7 +17,6 @@ along with GNU Emacs. If not, see . */ #include -#include #include /* for 'environ', on AIX */ #include "lisp.h" #include "mem-limits.h" === modified file 'src/widget.c' --- src/widget.c 2012-09-07 01:27:44 +0000 +++ src/widget.c 2012-09-14 19:35:57 +0000 @@ -30,7 +30,7 @@ #include #include -#include + #include "lisp.h" #include "xterm.h" === modified file 'src/window.c' --- src/window.c 2012-09-11 15:42:50 +0000 +++ src/window.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #define WINDOW_INLINE EXTERN_INLINE #include -#include #include "lisp.h" #include "character.h" === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-14 06:55:38 +0000 +++ src/xdisp.c 2012-09-14 19:35:57 +0000 @@ -273,7 +273,6 @@ #include #include #include -#include #include "lisp.h" #include "keyboard.h" === modified file 'src/xfaces.c' --- src/xfaces.c 2012-09-11 22:59:50 +0000 +++ src/xfaces.c 2012-09-14 19:35:57 +0000 @@ -204,7 +204,6 @@ #include #include #include /* This needs to be before termchar.h */ -#include #include "lisp.h" #include "character.h" === modified file 'src/xfns.c' --- src/xfns.c 2012-08-18 06:06:39 +0000 +++ src/xfns.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #include #include #include -#include #include /* This makes the fields of a Display accessible, in Xlib header files. */ === modified file 'src/xfont.c' --- src/xfont.c 2012-09-06 08:04:49 +0000 +++ src/xfont.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/xftfont.c' --- src/xftfont.c 2012-09-06 08:04:49 +0000 +++ src/xftfont.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include #include === modified file 'src/xgselect.c' --- src/xgselect.c 2012-09-11 22:59:50 +0000 +++ src/xgselect.c 2012-09-14 19:35:57 +0000 @@ -19,14 +19,12 @@ #include -#include #include "xgselect.h" #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) #include #include -#include #include "xterm.h" int === modified file 'src/xmenu.c' --- src/xmenu.c 2012-09-07 01:27:44 +0000 +++ src/xmenu.c 2012-09-14 19:35:57 +0000 @@ -33,7 +33,6 @@ #include #include -#include #include "lisp.h" #include "keyboard.h" === modified file 'src/xml.c' --- src/xml.c 2012-06-16 12:24:15 +0000 +++ src/xml.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #ifdef HAVE_LIBXML2 -#include #include #include #include === modified file 'src/xrdb.c' --- src/xrdb.c 2012-07-05 18:35:48 +0000 +++ src/xrdb.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #include #include -#include #include "lisp.h" === modified file 'src/xselect.c' --- src/xselect.c 2012-09-04 17:34:54 +0000 +++ src/xselect.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #include #include #include /* termhooks.h needs this */ -#include #ifdef HAVE_SYS_TYPES_H #include === modified file 'src/xsettings.c' --- src/xsettings.c 2012-07-12 03:45:46 +0000 +++ src/xsettings.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include #include "lisp.h" #include "xterm.h" @@ -711,12 +710,12 @@ if (send_event_p) store_config_changed_event (Qfont_render, XCAR (dpyinfo->name_list_element)); - Vxft_settings + Vxft_settings = make_formatted_string (buf, format, oldsettings.aa, oldsettings.hinting, oldsettings.rgba, oldsettings.lcdfilter, oldsettings.hintstyle, oldsettings.dpi); - + } else FcPatternDestroy (pat); === modified file 'src/xsmfns.c' --- src/xsmfns.c 2012-08-27 17:23:48 +0000 +++ src/xsmfns.c 2012-09-14 19:35:57 +0000 @@ -29,7 +29,6 @@ #include #include #include -#include #include "lisp.h" #include "systime.h" === modified file 'src/xterm.c' --- src/xterm.c 2012-09-13 02:21:28 +0000 +++ src/xterm.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #include #include -#include #ifdef HAVE_X_WINDOWS @@ -47,7 +46,6 @@ #include #include -#include #include /* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */ /* #include */ From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Sep 2012 20:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Paul Eggert Cc: lekktu@gmail.com, 12446@debbugs.gnu.org X-Debbugs-Original-Cc: lekktu@gmail.com, bug-gnu-emacs@gnu.org Reply-To: Eli Zaretskii Received: via spool by submit@debbugs.gnu.org id=B.134765473512578 (code B ref -1); Fri, 14 Sep 2012 20:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Sep 2012 20:32:15 +0000 Received: from localhost ([127.0.0.1]:34277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCcYg-0003Go-LD for submit@debbugs.gnu.org; Fri, 14 Sep 2012 16:32:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60433) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCcYd-0003Gf-W2 for submit@debbugs.gnu.org; Fri, 14 Sep 2012 16:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCcXc-00019Y-OM for submit@debbugs.gnu.org; Fri, 14 Sep 2012 16:31:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:46783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCcXc-00019U-La for submit@debbugs.gnu.org; Fri, 14 Sep 2012 16:31:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:32943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCcXX-0001da-14 for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 16:31:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCcXV-00018J-SH for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 16:31:02 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:41701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCcXV-000183-K2 for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 16:31:01 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MAC00C00WY24G00@a-mtaout23.012.net.il> for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 23:30:59 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAC00CD0WZN0O30@a-mtaout23.012.net.il>; Fri, 14 Sep 2012 23:30:59 +0300 (IDT) Date: Fri, 14 Sep 2012 23:30:59 +0300 From: Eli Zaretskii In-reply-to: <50538925.3010608@cs.ucla.edu> X-012-Sender: halo1@inter.net.il Message-id: <83txv0tkho.fsf@gnu.org> References: <50538925.3010608@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -7.4 (-------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.4 (-------) > Date: Fri, 14 Sep 2012 12:44:37 -0700 > From: Paul Eggert > CC: Eli Zaretskii , Juanma Barranquero > > + Port better to POSIX hosts lacking _setjmp. > + * lisp.h: Include here, since we use its symbols here. > + All instances of '#include ' 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? From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Sep 2012 21:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134765816917901 (code B ref 12446); Fri, 14 Sep 2012 21:30:03 +0000 Received: (at 12446) by debbugs.gnu.org; 14 Sep 2012 21:29:29 +0000 Received: from localhost ([127.0.0.1]:34340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCdS4-0004ef-CE for submit@debbugs.gnu.org; Fri, 14 Sep 2012 17:29:28 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:39818) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCdS0-0004eV-0X for 12446@debbugs.gnu.org; Fri, 14 Sep 2012 17:29:26 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id EF51A39E800E; Fri, 14 Sep 2012 14:28:23 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DcL2svc234Ze; Fri, 14 Sep 2012 14:28:23 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id A789F39E8008; Fri, 14 Sep 2012 14:28:23 -0700 (PDT) Message-ID: <5053A177.1020608@cs.ucla.edu> Date: Fri, 14 Sep 2012 14:28:23 -0700 From: Paul Eggert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 MIME-Version: 1.0 References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> In-Reply-To: <83txv0tkho.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) On 09/14/2012 01:30 PM, Eli Zaretskii wrote: > Why not simply switch to using > ANSI- and Posix-standard setjmp/longjmp? Because longjmp might alter the signal mask, and it might not. POSIX doesn't say either way, platforms differ in this respect, and the differences can mess things up and slow things down. This is why Emacs uses _longjmp now, on GNU and POSIXish platforms. From unknown Mon Jun 23 07:53:18 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Paul Eggert Subject: bug#12446: closed (Re: port better to POSIX hosts lacking _setjmp) Message-ID: References: <505429CC.3000209@cs.ucla.edu> <50538925.3010608@cs.ucla.edu> X-Gnu-PR-Message: they-closed 12446 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 12446@debbugs.gnu.org Date: Sat, 15 Sep 2012 07:12:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1347693122-15008-1" This is a multi-part message in MIME format... ------------=_1347693122-15008-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #12446: port better to POSIX hosts lacking _setjmp which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 12446@debbugs.gnu.org. --=20 12446: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12446 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1347693122-15008-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 12446-done) by debbugs.gnu.org; 15 Sep 2012 07:11:13 +0000 Received: from localhost ([127.0.0.1]:34686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCmX3-0003t6-K1 for submit@debbugs.gnu.org; Sat, 15 Sep 2012 03:11:13 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:57392) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCmWz-0003su-N7 for 12446-done@debbugs.gnu.org; Sat, 15 Sep 2012 03:11:12 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 1BF4339E8013; Sat, 15 Sep 2012 00:10:07 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MNZ1QKRwjv2t; Sat, 15 Sep 2012 00:10:06 -0700 (PDT) Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id BBAC639E8008; Sat, 15 Sep 2012 00:10:06 -0700 (PDT) Message-ID: <505429CC.3000209@cs.ucla.edu> Date: Sat, 15 Sep 2012 00:10:04 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: 12446-done@debbugs.gnu.org Subject: Re: port better to POSIX hosts lacking _setjmp References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> In-Reply-To: <5053A177.1020608@cs.ucla.edu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 12446-done Cc: lekktu@gmail.com, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) I installed this into the trunk as bzr 110035 and am marking the bug as done. ------------=_1347693122-15008-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 14 Sep 2012 19:46:22 +0000 Received: from localhost ([127.0.0.1]:34205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCbqF-0002AL-HT for submit@debbugs.gnu.org; Fri, 14 Sep 2012 15:46:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36889) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCbq9-0002AA-Ou for submit@debbugs.gnu.org; Fri, 14 Sep 2012 15:46:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCbp2-0008DT-Ru for submit@debbugs.gnu.org; Fri, 14 Sep 2012 15:45:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:34317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCbp2-0008D0-Od for submit@debbugs.gnu.org; Fri, 14 Sep 2012 15:45:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCbot-0005ko-MT for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 15:45:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCbon-0007zy-GC for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 15:44:55 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:40494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCbom-0007xz-S1; Fri, 14 Sep 2012 15:44:49 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 9347D39E8008; Fri, 14 Sep 2012 12:44:40 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XxHdeW-9SSRM; Fri, 14 Sep 2012 12:44:37 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 746D139E800E; Fri, 14 Sep 2012 12:44:37 -0700 (PDT) Message-ID: <50538925.3010608@cs.ucla.edu> Date: Fri, 14 Sep 2012 12:44:37 -0700 From: Paul Eggert User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: port better to POSIX hosts lacking _setjmp Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit Cc: Juanma Barranquero , Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Tags: patch Here's a patch I plan to install after a bit more testing. It affects the use of setjmp / _setjmp and so the Windows port probably needs to be updated (for the symbols HAVE__SETJMP and/or HAVE_SIGSETJMP). I don't think it breaks anything in Windows but have not looked at the Windows port closely and I could be mistaken. I'm CC'ing this to Eli and Juanma as a heads-up. === modified file 'ChangeLog' --- ChangeLog 2012-09-14 18:56:19 +0000 +++ ChangeLog 2012-09-14 19:35:57 +0000 @@ -1,5 +1,9 @@ 2012-09-14 Paul Eggert + Port better to POSIX hosts lacking _setjmp. + * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols. + (_setjmp, _longjmp): Remove. + * configure.ac: Port to hosts lacking gtk. (PKG_CHECK_MODULES): Capture pkg-config diagnostics better, in particular, problems in invoking pkg-config itself. === modified file 'configure.ac' --- configure.ac 2012-09-14 18:56:19 +0000 +++ configure.ac 2012-09-14 19:35:57 +0000 @@ -3774,13 +3774,24 @@ _longjmp (j, 1);]])], [emacs_cv_func__setjmp=yes], [emacs_cv_func__setjmp=no])]) -if test $emacs_cv_func__setjmp = no; then - AC_DEFINE([_setjmp], [setjmp], - [Define to setjmp if _setjmp and _longjmp do not work. See _longjmp.]) - AC_DEFINE([_longjmp], [longjmp], - [Define to longjmp if _setjmp and _longjmp do not work. - Because longjmp may alter signal masks, callers of _longjmp - should not assume that it leaves signal masks alone.]) +if test $emacs_cv_func__setjmp = yes; then + AC_DEFINE([HAVE__SETJMP], 1, [Define to 1 if _setjmp and _longjmp work.]) +else + AC_CACHE_CHECK([for sigsetjmp], [emacs_cv_func_sigsetjmp], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[sigjmp_buf j; + if (! sigsetjmp (j, 1)) + siglongjmp (j, 1);]])], + [emacs_cv_func_sigsetjmp=yes], + [emacs_cv_func_sigsetjmp=no])]) + if test $emacs_cv_func_sigsetjmp = yes; then + AC_DEFINE([HAVE_SIGSETJMP], 1, + [Define to 1 if sigsetjmp and siglongjmp work. + The value of this symbol is irrelevant if HAVE__SETJMP is defined.]) + fi fi case $opsys in === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-14 14:23:50 +0000 +++ src/ChangeLog 2012-09-14 19:35:57 +0000 @@ -1,3 +1,24 @@ +2012-09-14 Paul Eggert + + Port better to POSIX hosts lacking _setjmp. + * lisp.h: Include here, since we use its symbols here. + All instances of '#include ' 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. + 2012-09-14 Dmitry Antipov Avoid out-of-range marker position (Bug#12426). === modified file 'src/alloc.c' --- src/alloc.c 2012-09-13 05:18:26 +0000 +++ src/alloc.c 2012-09-14 19:35:57 +0000 @@ -24,7 +24,6 @@ #include #include /* For CHAR_BIT. */ -#include #ifdef ENABLE_CHECKING #include /* For SIGABRT. */ @@ -45,7 +44,7 @@ #include "frame.h" #include "blockinput.h" #include "termhooks.h" /* For struct terminal. */ -#include + #include /* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects. @@ -4762,14 +4761,14 @@ { char buf[10]; register int x; - jmp_buf jbuf; + sys_jmp_buf jbuf; /* Arrange for X to be put in a register. */ sprintf (buf, "1"); x = strlen (buf); x = 2 * x - 1; - _setjmp (jbuf); + sys_setjmp (jbuf); if (longjmps_done == 1) { /* Came here after the longjmp at the end of the function. @@ -4794,7 +4793,7 @@ ++longjmps_done; x = 2; if (longjmps_done == 1) - _longjmp (jbuf, 1); + sys_longjmp (jbuf, 1); } #endif /* not GC_SAVE_REGISTERS_ON_STACK && not GC_SETJMP_WORKS */ @@ -4900,7 +4899,7 @@ /* jmp_buf may not be aligned enough on darwin-ppc64 */ union aligned_jmpbuf { Lisp_Object o; - jmp_buf j; + sys_jmp_buf j; } j; volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base; #endif @@ -4936,7 +4935,7 @@ } #endif /* GC_SETJMP_WORKS */ - _setjmp (j.j); + sys_setjmp (j.j); end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; #endif /* not GC_SAVE_REGISTERS_ON_STACK */ #endif /* not HAVE___BUILTIN_UNWIND_INIT */ === modified file 'src/atimer.c' --- src/atimer.c 2012-09-07 01:27:44 +0000 +++ src/atimer.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,7 @@ #include #include -#include + #include "lisp.h" #include "syssignal.h" #include "systime.h" === modified file 'src/bidi.c' --- src/bidi.c 2012-09-11 22:59:50 +0000 +++ src/bidi.c 2012-09-14 19:35:57 +0000 @@ -56,7 +56,6 @@ #include #include -#include #include "lisp.h" #include "character.h" === modified file 'src/buffer.c' --- src/buffer.c 2012-09-11 04:22:03 +0000 +++ src/buffer.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #include #include #include -#include #include #include === modified file 'src/bytecode.c' --- src/bytecode.c 2012-09-04 17:34:54 +0000 +++ src/bytecode.c 2012-09-14 19:35:57 +0000 @@ -33,7 +33,7 @@ */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/callint.c' --- src/callint.c 2012-08-25 03:11:12 +0000 +++ src/callint.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include -#include #include "lisp.h" #include "character.h" === modified file 'src/callproc.c' --- src/callproc.c 2012-09-07 01:27:44 +0000 +++ src/callproc.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include === modified file 'src/casefiddle.c' --- src/casefiddle.c 2012-08-25 06:25:00 +0000 +++ src/casefiddle.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/casetab.c' --- src/casetab.c 2012-08-25 06:25:00 +0000 +++ src/casetab.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/category.c' --- src/category.c 2012-08-25 06:25:00 +0000 +++ src/category.c 2012-09-14 19:35:57 +0000 @@ -32,7 +32,6 @@ #define CATEGORY_INLINE EXTERN_INLINE -#include #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/ccl.c' --- src/ccl.c 2012-07-05 06:32:41 +0000 +++ src/ccl.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/character.c' --- src/character.c 2012-09-04 17:34:54 +0000 +++ src/character.c 2012-09-14 19:35:57 +0000 @@ -36,7 +36,6 @@ #ifdef emacs #include -#include #include #include "lisp.h" #include "character.h" === modified file 'src/charset.c' --- src/charset.c 2012-09-04 17:34:54 +0000 +++ src/charset.c 2012-09-14 19:35:57 +0000 @@ -32,7 +32,6 @@ #include #include #include -#include #include #include "lisp.h" #include "character.h" === modified file 'src/chartab.c' --- src/chartab.c 2012-08-26 08:41:36 +0000 +++ src/chartab.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "charset.h" === modified file 'src/cm.c' --- src/cm.c 2012-09-04 17:34:54 +0000 +++ src/cm.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #include #include -#include #include "lisp.h" #include "frame.h" === modified file 'src/cmds.c' --- src/cmds.c 2012-08-27 16:19:34 +0000 +++ src/cmds.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" === modified file 'src/coding.c' --- src/coding.c 2012-09-04 17:34:54 +0000 +++ src/coding.c 2012-09-14 19:35:57 +0000 @@ -285,7 +285,6 @@ #include #include -#include #include "lisp.h" #include "character.h" === modified file 'src/composite.c' --- src/composite.c 2012-08-27 17:23:48 +0000 +++ src/composite.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #define COMPOSITE_INLINE EXTERN_INLINE -#include #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/data.c' --- src/data.c 2012-09-12 19:16:36 +0000 +++ src/data.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #include #include -#include #include === modified file 'src/dbusbind.c' --- src/dbusbind.c 2012-08-27 17:23:48 +0000 +++ src/dbusbind.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,7 @@ #ifdef HAVE_DBUS #include #include -#include + #include "lisp.h" #include "frame.h" #include "termhooks.h" === modified file 'src/dired.c' --- src/dired.c 2012-09-04 17:34:54 +0000 +++ src/dired.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #include #include #include -#include #ifdef HAVE_PWD_H #include === modified file 'src/dispnew.c' --- src/dispnew.c 2012-09-13 02:21:28 +0000 +++ src/dispnew.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #define DISPEXTERN_INLINE EXTERN_INLINE #include -#include #include #include "lisp.h" === modified file 'src/doc.c' --- src/doc.c 2012-09-03 19:36:09 +0000 +++ src/doc.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #include #include /* Must be after sys/types.h for USG*/ -#include #include #include === modified file 'src/doprnt.c' --- src/doprnt.c 2012-09-09 16:06:33 +0000 +++ src/doprnt.c 2012-09-14 19:35:57 +0000 @@ -102,7 +102,6 @@ #include #include -#include #include #include #include === modified file 'src/dosfns.c' --- src/dosfns.c 2012-08-17 21:52:15 +0000 +++ src/dosfns.c 2012-09-14 19:35:57 +0000 @@ -30,7 +30,7 @@ #include #undef gettime #undef settime -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/editfns.c' --- src/editfns.c 2012-09-11 04:22:03 +0000 +++ src/editfns.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include #include -#include #ifdef HAVE_PWD_H #include === modified file 'src/emacs.c' --- src/emacs.c 2012-09-13 02:21:28 +0000 +++ src/emacs.c 2012-09-14 19:35:57 +0000 @@ -25,7 +25,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/emacsgtkfixed.c' --- src/emacsgtkfixed.c 2012-09-13 04:14:33 +0000 +++ src/emacsgtkfixed.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,7 @@ #include "emacsgtkfixed.h" #include -#include + #include "lisp.h" #include "frame.h" #include "xterm.h" === modified file 'src/eval.c' --- src/eval.c 2012-09-12 21:34:24 +0000 +++ src/eval.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include #include -#include #include #include "lisp.h" #include "blockinput.h" @@ -1072,7 +1071,7 @@ catchlist = &c; /* Call FUNC. */ - if (! _setjmp (c.jmp)) + if (! sys_setjmp (c.jmp)) c.val = (*func) (arg); /* Throw works by a longjmp that comes right here. */ @@ -1140,7 +1139,7 @@ backtrace_list = catch->backlist; lisp_eval_depth = catch->lisp_eval_depth; - _longjmp (catch->jmp, 1); + sys_longjmp (catch->jmp, 1); } DEFUN ("throw", Fthrow, Sthrow, 2, 2, 0, @@ -1246,7 +1245,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { if (!NILP (h.var)) specbind (h.var, c.val); @@ -1301,7 +1300,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1339,7 +1338,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1381,7 +1380,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1425,7 +1424,7 @@ c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val, nargs, args); } === modified file 'src/fileio.c' --- src/fileio.c 2012-09-05 07:18:46 +0000 +++ src/fileio.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #include #include #include -#include #include #ifdef HAVE_PWD_H === modified file 'src/filelock.c' --- src/filelock.c 2012-09-05 07:18:46 +0000 +++ src/filelock.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #include #include #include -#include #ifdef HAVE_PWD_H #include === modified file 'src/floatfns.c' --- src/floatfns.c 2012-09-11 02:28:27 +0000 +++ src/floatfns.c 2012-09-14 19:35:57 +0000 @@ -29,7 +29,7 @@ */ #include -#include + #include "lisp.h" #include "syssignal.h" === modified file 'src/fns.c' --- src/fns.c 2012-09-11 22:59:50 +0000 +++ src/fns.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include === modified file 'src/font.c' --- src/font.c 2012-09-06 08:04:49 +0000 +++ src/font.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #include #include #include -#include #include === modified file 'src/fontset.c' --- src/fontset.c 2012-09-06 08:04:49 +0000 +++ src/fontset.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #include #include -#include #include "lisp.h" #include "blockinput.h" === modified file 'src/frame.c' --- src/frame.c 2012-09-13 05:18:26 +0000 +++ src/frame.c 2012-09-14 19:35:57 +0000 @@ -24,7 +24,6 @@ #include #include #include -#include #include === modified file 'src/fringe.c' --- src/fringe.c 2012-09-09 20:10:36 +0000 +++ src/fringe.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,6 @@ #include #include -#include #include "lisp.h" #include "frame.h" === modified file 'src/ftfont.c' --- src/ftfont.c 2012-09-06 08:04:49 +0000 +++ src/ftfont.c 2012-09-14 19:35:57 +0000 @@ -21,8 +21,6 @@ #include #include -#include - #include #include === modified file 'src/ftxfont.c' --- src/ftxfont.c 2012-09-06 08:04:49 +0000 +++ src/ftxfont.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/gnutls.c' --- src/gnutls.c 2012-08-18 02:49:24 +0000 +++ src/gnutls.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,6 @@ #include #include -#include #include "lisp.h" #include "process.h" === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-09-07 01:27:44 +0000 +++ src/gtkutil.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #ifdef USE_GTK #include #include -#include #include === modified file 'src/image.c' --- src/image.c 2012-09-13 01:22:08 +0000 +++ src/image.c 2012-09-14 19:35:57 +0000 @@ -5514,6 +5514,13 @@ #endif /* HAVE_NTGUI */ +/* Possibly inefficient/inexact substitutes for _setjmp and _longjmp. + Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp + substitute may munge the signal mask, but that should be OK here. */ +#ifndef HAVE__SETJMP +# define _setjmp(j) setjmp (j) +# define _longjmp longjmp +#endif #if (PNG_LIBPNG_VER < 10500) #define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1)) @@ -5593,7 +5600,7 @@ struct png_load_context { - /* These are members so that _longjmp doesn't munge local variables. */ + /* These are members so that longjmp doesn't munge local variables. */ png_struct *png_ptr; png_info *info_ptr; png_info *end_info; @@ -6129,9 +6136,9 @@ struct my_jpeg_error_mgr { struct jpeg_error_mgr pub; - jmp_buf setjmp_buffer; + sys_jmp_buf setjmp_buffer; - /* The remaining members are so that _longjmp doesn't munge local + /* The remaining members are so that longjmp doesn't munge local variables. */ struct jpeg_decompress_struct cinfo; enum @@ -6151,7 +6158,7 @@ { struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err; mgr->failure_code = MY_JPEG_ERROR_EXIT; - _longjmp (mgr->setjmp_buffer, 1); + sys_longjmp (mgr->setjmp_buffer, 1); } @@ -6401,7 +6408,7 @@ error is detected. This function will perform a longjmp. */ mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub); mgr->pub.error_exit = my_error_exit; - if (_setjmp (mgr->setjmp_buffer)) + if (sys_setjmp (mgr->setjmp_buffer)) { switch (mgr->failure_code) { @@ -6460,14 +6467,14 @@ if (!check_image_size (f, width, height)) { mgr->failure_code = MY_JPEG_INVALID_IMAGE_SIZE; - _longjmp (mgr->setjmp_buffer, 1); + sys_longjmp (mgr->setjmp_buffer, 1); } /* Create X image and pixmap. */ if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) { mgr->failure_code = MY_JPEG_CANNOT_CREATE_X; - _longjmp (mgr->setjmp_buffer, 1); + sys_longjmp (mgr->setjmp_buffer, 1); } /* Allocate colors. When color quantization is used, === modified file 'src/indent.c' --- src/indent.c 2012-09-04 17:34:54 +0000 +++ src/indent.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include #include -#include #include "lisp.h" #include "character.h" === modified file 'src/insdel.c' --- src/insdel.c 2012-09-14 14:23:50 +0000 +++ src/insdel.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include -#include #include === modified file 'src/intervals.c' --- src/intervals.c 2012-09-04 17:34:54 +0000 +++ src/intervals.c 2012-09-14 19:35:57 +0000 @@ -41,7 +41,6 @@ #define INTERVALS_INLINE EXTERN_INLINE -#include #include #include "lisp.h" #include "intervals.h" === modified file 'src/keyboard.c' --- src/keyboard.c 2012-09-13 16:23:06 +0000 +++ src/keyboard.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,7 @@ #define KEYBOARD_INLINE EXTERN_INLINE #include -#include + #include "lisp.h" #include "termchar.h" #include "termopts.h" @@ -145,7 +145,7 @@ /* For longjmp to where kbd input is being done. */ -static jmp_buf getcjmp; +static sys_jmp_buf getcjmp; /* True while doing kbd input. */ int waiting_for_input; @@ -434,8 +434,8 @@ Lisp_Object *, ptrdiff_t); static Lisp_Object make_lispy_switch_frame (Lisp_Object); static int help_char_p (Lisp_Object); -static void save_getcjmp (jmp_buf); -static void restore_getcjmp (jmp_buf); +static void save_getcjmp (sys_jmp_buf); +static void restore_getcjmp (sys_jmp_buf); static Lisp_Object apply_modifiers (int, Lisp_Object); static void clear_event (struct input_event *); static Lisp_Object restore_kboard_configuration (Lisp_Object); @@ -2315,8 +2315,8 @@ { volatile Lisp_Object c; ptrdiff_t jmpcount; - jmp_buf local_getcjmp; - jmp_buf save_jump; + sys_jmp_buf local_getcjmp; + sys_jmp_buf save_jump; volatile int key_already_recorded = 0; Lisp_Object tem, save; volatile Lisp_Object previous_echo_area_message; @@ -2562,7 +2562,7 @@ it *must not* be in effect when we call redisplay. */ jmpcount = SPECPDL_INDEX (); - if (_setjmp (local_getcjmp)) + if (sys_setjmp (local_getcjmp)) { /* Handle quits while reading the keyboard. */ /* We must have saved the outer value of getcjmp here, @@ -3394,13 +3394,13 @@ See read_process_output. */ static void -save_getcjmp (jmp_buf temp) +save_getcjmp (sys_jmp_buf temp) { memcpy (temp, getcjmp, sizeof getcjmp); } static void -restore_getcjmp (jmp_buf temp) +restore_getcjmp (sys_jmp_buf temp) { memcpy (getcjmp, temp, sizeof getcjmp); } @@ -10979,7 +10979,7 @@ do_switch_frame (make_lispy_switch_frame (internal_last_event_frame), 0, 0, Qnil); - _longjmp (getcjmp, 1); + sys_longjmp (getcjmp, 1); } DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, === modified file 'src/keymap.c' --- src/keymap.c 2012-09-04 17:34:54 +0000 +++ src/keymap.c 2012-09-14 19:35:57 +0000 @@ -40,7 +40,7 @@ #include #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" === modified file 'src/lisp.h' --- src/lisp.h 2012-09-11 23:50:28 +0000 +++ src/lisp.h 2012-09-14 19:35:57 +0000 @@ -20,6 +20,7 @@ #ifndef EMACS_LISP_H #define EMACS_LISP_H +#include #include #include #include @@ -1963,7 +1964,24 @@ static struct Lisp_Kboard_Objfwd ko_fwd; \ defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \ } while (0) + +/* Save and restore the instruction and environment pointers, + without affecting the signal mask. */ +#ifdef HAVE__SETJMP +typedef jmp_buf sys_jmp_buf; +# define sys_setjmp(j) _setjmp (j) +# define sys_longjmp(j, v) _longjmp (j, v) +#elif defined HAVE_SIGSETJMP +typedef sigjmp_buf sys_jmp_buf; +# define sys_setjmp(j) sigsetjmp (j, 0) +# define sys_longjmp(j, v) siglongjmp (j, v) +#else +/* A non-POSIX platform; assume longjmp does not affect the sigmask. */ +typedef jmp_buf sys_jmp_buf; +# define sys_setjmp(j) setjmp (j) +# define sys_longjmp(j, v) longjmp (j, v) +#endif /* Structure for recording Lisp call stack for backtrace purposes. */ @@ -2056,7 +2074,7 @@ Lisp_Object volatile val; struct catchtag *volatile next; struct gcpro *gcpro; - jmp_buf jmp; + sys_jmp_buf jmp; struct backtrace *backlist; struct handler *handlerlist; EMACS_INT lisp_eval_depth; === modified file 'src/lread.c' --- src/lread.c 2012-09-11 04:22:03 +0000 +++ src/lread.c 2012-09-14 19:35:57 +0000 @@ -25,7 +25,6 @@ #include #include #include /* For CHAR_BIT. */ -#include #include #include "lisp.h" #include "intervals.h" === modified file 'src/macros.c' --- src/macros.c 2012-08-17 23:38:43 +0000 +++ src/macros.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ #include -#include + #include "lisp.h" #include "macros.h" #include "commands.h" === modified file 'src/marker.c' --- src/marker.c 2012-09-11 04:22:03 +0000 +++ src/marker.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,7 @@ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/menu.c' --- src/menu.c 2012-09-04 17:34:54 +0000 +++ src/menu.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #include #include -#include #include /* for INT_MAX */ #include "lisp.h" === modified file 'src/minibuf.c' --- src/minibuf.c 2012-09-11 04:22:03 +0000 +++ src/minibuf.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include #include -#include #include "lisp.h" #include "commands.h" === modified file 'src/nsfns.m' --- src/nsfns.m 2012-09-07 01:27:44 +0000 +++ src/nsfns.m 2012-09-14 19:35:57 +0000 @@ -31,7 +31,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/nsfont.m' --- src/nsfont.m 2012-09-06 08:04:49 +0000 +++ src/nsfont.m 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "dispextern.h" === modified file 'src/nsimage.m' --- src/nsimage.m 2012-08-16 21:58:44 +0000 +++ src/nsimage.m 2012-09-14 19:35:57 +0000 @@ -28,7 +28,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "dispextern.h" === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-09-04 17:34:54 +0000 +++ src/nsmenu.m 2012-09-14 19:35:57 +0000 @@ -24,7 +24,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "window.h" === modified file 'src/nsselect.m' --- src/nsselect.m 2012-08-07 13:37:21 +0000 +++ src/nsselect.m 2012-09-14 19:35:57 +0000 @@ -28,7 +28,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "nsterm.h" === modified file 'src/nsterm.m' --- src/nsterm.m 2012-09-11 17:08:02 +0000 +++ src/nsterm.m 2012-09-14 19:35:57 +0000 @@ -35,7 +35,6 @@ #include #include #include -#include #include #include === modified file 'src/print.c' --- src/print.c 2012-09-11 04:22:03 +0000 +++ src/print.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,7 @@ #include #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/process.c' --- src/process.c 2012-09-13 02:21:28 +0000 +++ src/process.c 2012-09-14 19:35:57 +0000 @@ -25,12 +25,9 @@ #include #include -#include #include /* Some typedefs are used in sys/file.h. */ #include #include -#include - #include #include @@ -5421,7 +5418,7 @@ /* Sending data to subprocess */ -static jmp_buf send_process_frame; +static sys_jmp_buf send_process_frame; static Lisp_Object process_sent_to; static _Noreturn void @@ -5431,7 +5428,7 @@ sigemptyset (&unblocked); sigaddset (&unblocked, SIGPIPE); pthread_sigmask (SIG_UNBLOCK, &unblocked, 0); - _longjmp (send_process_frame, 1); + sys_longjmp (send_process_frame, 1); } static void @@ -5640,7 +5637,7 @@ /* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2, CFLAGS="-g -O": The value of the parameter `proc' is clobbered when returning with longjmp despite being declared volatile. */ - if (!_setjmp (send_process_frame)) + if (!sys_setjmp (send_process_frame)) { p = XPROCESS (proc); /* Repair any setjmp clobbering. */ process_sent_to = proc; === modified file 'src/ralloc.c' --- src/ralloc.c 2012-09-04 17:34:54 +0000 +++ src/ralloc.c 2012-09-14 19:35:57 +0000 @@ -25,7 +25,7 @@ #ifdef emacs #include -#include + #include "lisp.h" /* Needed for VALBITS. */ #include "blockinput.h" === modified file 'src/regex.c' --- src/regex.c 2012-09-03 19:36:09 +0000 +++ src/regex.c 2012-09-14 19:35:57 +0000 @@ -126,7 +126,6 @@ that make sense only in Emacs. */ #ifdef emacs -# include # include "lisp.h" # include "character.h" # include "buffer.h" === modified file 'src/region-cache.c' --- src/region-cache.c 2012-09-04 17:34:54 +0000 +++ src/region-cache.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include "lisp.h" #include "character.h" === modified file 'src/scroll.c' --- src/scroll.c 2012-09-04 17:34:54 +0000 +++ src/scroll.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,7 @@ #include #include -#include + #include "lisp.h" #include "termchar.h" #include "dispextern.h" === modified file 'src/search.c' --- src/search.c 2012-09-04 17:34:54 +0000 +++ src/search.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,7 @@ #include -#include + #include "lisp.h" #include "syntax.h" #include "category.h" === modified file 'src/sheap.c' --- src/sheap.c 2012-01-19 07:21:25 +0000 +++ src/sheap.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,7 @@ #include #include -#include + #include "lisp.h" #include @@ -93,4 +93,3 @@ bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); message ("%s", buf); } - === modified file 'src/sound.c' --- src/sound.c 2012-09-13 02:21:28 +0000 +++ src/sound.c 2012-09-14 19:35:57 +0000 @@ -44,7 +44,7 @@ #include #include #include -#include + #include "lisp.h" #include "dispextern.h" #include "atimer.h" === modified file 'src/syntax.c' --- src/syntax.c 2012-09-08 14:23:01 +0000 +++ src/syntax.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,7 @@ #include #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" === modified file 'src/sysdep.c' --- src/sysdep.c 2012-09-13 02:21:28 +0000 +++ src/sysdep.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #include #include -#include #ifdef HAVE_PWD_H #include #include === modified file 'src/term.c' --- src/term.c 2012-09-13 02:21:28 +0000 +++ src/term.c 2012-09-14 19:35:57 +0000 @@ -25,7 +25,6 @@ #include #include #include -#include #include "lisp.h" #include "termchar.h" === modified file 'src/termcap.c' --- src/termcap.c 2012-07-05 18:35:48 +0000 +++ src/termcap.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ /* Emacs config.h may rename various library functions such as malloc. */ #include -#include #include #include #include === modified file 'src/terminal.c' --- src/terminal.c 2012-09-04 17:34:54 +0000 +++ src/terminal.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #define TERMHOOKS_INLINE EXTERN_INLINE #include -#include #include "lisp.h" #include "frame.h" === modified file 'src/terminfo.c' --- src/terminfo.c 2012-09-04 17:34:54 +0000 +++ src/terminfo.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,6 @@ #include #include "tparam.h" -#include #include "lisp.h" /* Define these variables that serve as global parameters to termcap, === modified file 'src/textprop.c' --- src/textprop.c 2012-09-07 14:45:28 +0000 +++ src/textprop.c 2012-09-14 19:35:57 +0000 @@ -17,7 +17,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "intervals.h" #include "character.h" === modified file 'src/tparam.c' --- src/tparam.c 2012-09-04 17:34:54 +0000 +++ src/tparam.c 2012-09-14 19:35:57 +0000 @@ -19,7 +19,7 @@ /* Emacs config.h may rename various library functions such as malloc. */ #include -#include + #include "lisp.h" /* for xmalloc */ #include "tparam.h" === modified file 'src/undo.c' --- src/undo.c 2012-08-28 06:20:08 +0000 +++ src/undo.c 2012-09-14 19:35:57 +0000 @@ -18,7 +18,7 @@ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" === modified file 'src/unexaix.c' --- src/unexaix.c 2012-08-19 20:02:24 +0000 +++ src/unexaix.c 2012-09-14 19:35:57 +0000 @@ -89,7 +89,6 @@ static int pagemask; -#include #include "lisp.h" static void === modified file 'src/unexcoff.c' --- src/unexcoff.c 2012-08-19 20:02:24 +0000 +++ src/unexcoff.c 2012-09-14 19:35:57 +0000 @@ -120,7 +120,6 @@ #define ADDR_CORRECT(x) ((char *)(x) - (char*)0) -#include #include "lisp.h" static void === modified file 'src/unexcw.c' --- src/unexcw.c 2012-01-19 07:21:25 +0000 +++ src/unexcw.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include "unexec.h" -#include #include #include #include === modified file 'src/unexsol.c' --- src/unexsol.c 2012-06-16 12:24:15 +0000 +++ src/unexsol.c 2012-09-14 19:35:57 +0000 @@ -4,7 +4,6 @@ #include "unexec.h" #include -#include #include "lisp.h" #include "character.h" === modified file 'src/vm-limit.c' --- src/vm-limit.c 2012-08-19 21:00:09 +0000 +++ src/vm-limit.c 2012-09-14 19:35:57 +0000 @@ -17,7 +17,6 @@ along with GNU Emacs. If not, see . */ #include -#include #include /* for 'environ', on AIX */ #include "lisp.h" #include "mem-limits.h" === modified file 'src/widget.c' --- src/widget.c 2012-09-07 01:27:44 +0000 +++ src/widget.c 2012-09-14 19:35:57 +0000 @@ -30,7 +30,7 @@ #include #include -#include + #include "lisp.h" #include "xterm.h" === modified file 'src/window.c' --- src/window.c 2012-09-11 15:42:50 +0000 +++ src/window.c 2012-09-14 19:35:57 +0000 @@ -23,7 +23,6 @@ #define WINDOW_INLINE EXTERN_INLINE #include -#include #include "lisp.h" #include "character.h" === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-14 06:55:38 +0000 +++ src/xdisp.c 2012-09-14 19:35:57 +0000 @@ -273,7 +273,6 @@ #include #include #include -#include #include "lisp.h" #include "keyboard.h" === modified file 'src/xfaces.c' --- src/xfaces.c 2012-09-11 22:59:50 +0000 +++ src/xfaces.c 2012-09-14 19:35:57 +0000 @@ -204,7 +204,6 @@ #include #include #include /* This needs to be before termchar.h */ -#include #include "lisp.h" #include "character.h" === modified file 'src/xfns.c' --- src/xfns.c 2012-08-18 06:06:39 +0000 +++ src/xfns.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #include #include #include -#include #include /* This makes the fields of a Display accessible, in Xlib header files. */ === modified file 'src/xfont.c' --- src/xfont.c 2012-09-06 08:04:49 +0000 +++ src/xfont.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include #include "lisp.h" === modified file 'src/xftfont.c' --- src/xftfont.c 2012-09-06 08:04:49 +0000 +++ src/xftfont.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include #include === modified file 'src/xgselect.c' --- src/xgselect.c 2012-09-11 22:59:50 +0000 +++ src/xgselect.c 2012-09-14 19:35:57 +0000 @@ -19,14 +19,12 @@ #include -#include #include "xgselect.h" #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) #include #include -#include #include "xterm.h" int === modified file 'src/xmenu.c' --- src/xmenu.c 2012-09-07 01:27:44 +0000 +++ src/xmenu.c 2012-09-14 19:35:57 +0000 @@ -33,7 +33,6 @@ #include #include -#include #include "lisp.h" #include "keyboard.h" === modified file 'src/xml.c' --- src/xml.c 2012-06-16 12:24:15 +0000 +++ src/xml.c 2012-09-14 19:35:57 +0000 @@ -20,7 +20,6 @@ #ifdef HAVE_LIBXML2 -#include #include #include #include === modified file 'src/xrdb.c' --- src/xrdb.c 2012-07-05 18:35:48 +0000 +++ src/xrdb.c 2012-09-14 19:35:57 +0000 @@ -26,7 +26,6 @@ #include #include -#include #include "lisp.h" === modified file 'src/xselect.c' --- src/xselect.c 2012-09-04 17:34:54 +0000 +++ src/xselect.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #include #include #include /* termhooks.h needs this */ -#include #ifdef HAVE_SYS_TYPES_H #include === modified file 'src/xsettings.c' --- src/xsettings.c 2012-07-12 03:45:46 +0000 +++ src/xsettings.c 2012-09-14 19:35:57 +0000 @@ -21,7 +21,6 @@ #include #include -#include #include #include "lisp.h" #include "xterm.h" @@ -711,12 +710,12 @@ if (send_event_p) store_config_changed_event (Qfont_render, XCAR (dpyinfo->name_list_element)); - Vxft_settings + Vxft_settings = make_formatted_string (buf, format, oldsettings.aa, oldsettings.hinting, oldsettings.rgba, oldsettings.lcdfilter, oldsettings.hintstyle, oldsettings.dpi); - + } else FcPatternDestroy (pat); === modified file 'src/xsmfns.c' --- src/xsmfns.c 2012-08-27 17:23:48 +0000 +++ src/xsmfns.c 2012-09-14 19:35:57 +0000 @@ -29,7 +29,6 @@ #include #include #include -#include #include "lisp.h" #include "systime.h" === modified file 'src/xterm.c' --- src/xterm.c 2012-09-13 02:21:28 +0000 +++ src/xterm.c 2012-09-14 19:35:57 +0000 @@ -22,7 +22,6 @@ #include #include -#include #ifdef HAVE_X_WINDOWS @@ -47,7 +46,6 @@ #include #include -#include #include /* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */ /* #include */ ------------=_1347693122-15008-1-- From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 07:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Paul Eggert Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134769324015206 (code B ref 12446); Sat, 15 Sep 2012 07:14:01 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 07:14:00 +0000 Received: from localhost ([127.0.0.1]:34695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCmZj-0003xC-W1 for submit@debbugs.gnu.org; Sat, 15 Sep 2012 03:14:00 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:61419) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCmZh-0003x4-Bw for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 03:13:58 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAD00D00QMUF100@a-mtaout20.012.net.il> for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 10:12:53 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAD00DQ2QPG7840@a-mtaout20.012.net.il>; Sat, 15 Sep 2012 10:12:52 +0300 (IDT) Date: Sat, 15 Sep 2012 10:12:53 +0300 From: Eli Zaretskii In-reply-to: <5053A177.1020608@cs.ucla.edu> X-012-Sender: halo1@inter.net.il Message-id: <83sjaju5ca.fsf@gnu.org> References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Fri, 14 Sep 2012 14:28:23 -0700 > From: Paul Eggert > CC: 12446@debbugs.gnu.org, lekktu@gmail.com > > On 09/14/2012 01:30 PM, Eli Zaretskii wrote: > > Why not simply switch to using > > ANSI- and Posix-standard setjmp/longjmp? > > Because longjmp might alter the signal mask, > and it might not. POSIX doesn't say either way, > platforms differ in this respect, and the > differences can mess things up and slow things down. Can you elaborate? On which platforms does longjmp change the signal mask and how, and in what ways can this "mess things up and slow things down"? From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 07:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134769548218435 (code B ref 12446); Sat, 15 Sep 2012 07:52:02 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 07:51:22 +0000 Received: from localhost ([127.0.0.1]:34706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCn9t-0004nI-R2 for submit@debbugs.gnu.org; Sat, 15 Sep 2012 03:51:22 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:58630) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCn9q-0004nA-Nj for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 03:51:20 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 73E0D39E800D; Sat, 15 Sep 2012 00:50:16 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H4SZYgLV52c8; Sat, 15 Sep 2012 00:50:16 -0700 (PDT) Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id F010539E8008; Sat, 15 Sep 2012 00:50:15 -0700 (PDT) Message-ID: <50543339.3090500@cs.ucla.edu> Date: Sat, 15 Sep 2012 00:50:17 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <83sjaju5ca.fsf@gnu.org> In-Reply-To: <83sjaju5ca.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) On 09/15/2012 12:12 AM, Eli Zaretskii wrote: > On which platforms does longjmp change the signal > mask and how, and in what ways can this "mess things up and slow > things down"? For example, under FreeBSD, setjmp saves the signal mask, and longjmp restores the signal mask to the value that it had when setjmp was called. See . FreeBSD is not alone in this -- it's sort of a BSD tradition -- but I don't have a list handy of exactly which OSes do it and which do not. Saving and restoring the signal mask takes time -- often system calls are involved. Emacs doesn't need the mask saved and restored, typically, so the effort is wasted. It's not uncommon for _setjmp+_longjmp to be 30x faster than setjmp+longjmp. This is partly why Emacs has long preferred _setjmp if available. Messups are trickier, because they involve rare race conditions. They can occur if Emacs or a system call has set the signal mask to X, but a longjump unexpectedly changes it to Y, where Y is not equal to X. This can happen if a signal handler invokes longjmp, either directly or indirectly. For example, Emacs signal handlers can invoke xmalloc, which can do a longjmp if memory is full, leading to a rare bug. Arguably signal handlers should not invoke malloc -- and I'll submit a patch shortly along those lines -- but regardless, it's better if Emacs's nonlocal gotos uniformly leave the signal mask alone, rather than leaving it alone on some hosts and messing with it on others. From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 08:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Paul Eggert Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134769659020037 (code B ref 12446); Sat, 15 Sep 2012 08:10:02 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 08:09:50 +0000 Received: from localhost ([127.0.0.1]:34715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCnRm-0005D8-JL for submit@debbugs.gnu.org; Sat, 15 Sep 2012 04:09:50 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:40399) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCnRk-0005Cz-5b for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 04:09:49 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAD00E00T7B1700@a-mtaout20.012.net.il> for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 11:08:45 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAD00DH6TAKUD40@a-mtaout20.012.net.il>; Sat, 15 Sep 2012 11:08:45 +0300 (IDT) Date: Sat, 15 Sep 2012 11:08:46 +0300 From: Eli Zaretskii In-reply-to: <505429CC.3000209@cs.ucla.edu> X-012-Sender: halo1@inter.net.il Message-id: <83pq5nu2r5.fsf@gnu.org> References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <505429CC.3000209@cs.ucla.edu> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 15 Sep 2012 00:10:04 -0700 > From: Paul Eggert > CC: Eli Zaretskii , lekktu@gmail.com > > I installed this into the trunk as bzr 110035 As you might have expected, it broke the MS-Windows build. Fixed in revision 110036 on the trunk. > and am marking the bug as done. If you know that your commit needs a followup in ports you don't care about and didn't included in the changes, please in the future don't mark the bug as done, as it might need more discussions and changes. From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 08:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Paul Eggert Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134769778021720 (code B ref 12446); Sat, 15 Sep 2012 08:30:01 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 08:29:40 +0000 Received: from localhost ([127.0.0.1]:34719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCnky-0005eH-88 for submit@debbugs.gnu.org; Sat, 15 Sep 2012 04:29:40 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:62034) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCnkv-0005e9-AO for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 04:29:38 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MAD00L00TJTV500@a-mtaout22.012.net.il> for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 11:28:18 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAD00LJHU76LP70@a-mtaout22.012.net.il>; Sat, 15 Sep 2012 11:28:18 +0300 (IDT) Date: Sat, 15 Sep 2012 11:28:19 +0300 From: Eli Zaretskii In-reply-to: <50543339.3090500@cs.ucla.edu> X-012-Sender: halo1@inter.net.il Message-id: <83ligbu1uk.fsf@gnu.org> References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <83sjaju5ca.fsf@gnu.org> <50543339.3090500@cs.ucla.edu> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 15 Sep 2012 00:50:17 -0700 > From: Paul Eggert > CC: 12446@debbugs.gnu.org, lekktu@gmail.com > > On 09/15/2012 12:12 AM, Eli Zaretskii wrote: > > On which platforms does longjmp change the signal > > mask and how, and in what ways can this "mess things up and slow > > things down"? > > For example, under FreeBSD, setjmp saves the signal mask, > and longjmp restores the signal mask to the value that it had > when setjmp was called. See > . > FreeBSD is not alone in this -- it's sort of a BSD tradition -- > but I don't have a list handy of exactly which OSes do it and > which do not. So what was the rationale of turning away from _setjmp, which does the same as sigsetjmp with its second argument zero? > Messups are trickier, because they involve rare race conditions. > They can occur if Emacs or a system call has set the signal mask to X, > but a longjump unexpectedly changes it to Y, where Y is not equal to X. Why is that a messup? From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 08:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134769885723403 (code B ref 12446); Sat, 15 Sep 2012 08:48:01 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 08:47:37 +0000 Received: from localhost ([127.0.0.1]:34723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCo2J-00065P-Oq for submit@debbugs.gnu.org; Sat, 15 Sep 2012 04:47:36 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:60230) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCo2F-00065F-SL for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 04:47:33 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 0C59439E8013; Sat, 15 Sep 2012 01:46:29 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zZBH-1dJe08i; Sat, 15 Sep 2012 01:46:28 -0700 (PDT) Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 964F739E8008; Sat, 15 Sep 2012 01:46:28 -0700 (PDT) Message-ID: <50544066.1010205@cs.ucla.edu> Date: Sat, 15 Sep 2012 01:46:30 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <505429CC.3000209@cs.ucla.edu> <83pq5nu2r5.fsf@gnu.org> In-Reply-To: <83pq5nu2r5.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) On 09/15/2012 01:08 AM, Eli Zaretskii wrote: > As you might have expected, it broke the MS-Windows build. Sorry, no, as I wrote in my original bug report, I didn't think it would break anything in the Microsoft builds. I am not an expert on MS-Windows. > Fixed in revision 110036 on the trunk. Thanks, but unfortunately that fix broke things for POSIXish hosts that lack _setjmp. I tried to fix the problem in a different way, by editing nt/config.nt, in trunk bzr 110037. Since I don't know what the problem was in the MS-Windows build, it's possible that the Microsoft side still has problems, but I expect that any problems should be minor and fixable by further edits to nt/config.nt or similar files. From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 08:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134769937724131 (code B ref 12446); Sat, 15 Sep 2012 08:57:02 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 08:56:17 +0000 Received: from localhost ([127.0.0.1]:34728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCoAi-0006H9-H4 for submit@debbugs.gnu.org; Sat, 15 Sep 2012 04:56:17 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:60490) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCoAg-0006H2-IA for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 04:56:15 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 4A27B39E8013; Sat, 15 Sep 2012 01:55:12 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8-ePmZeM6nO2; Sat, 15 Sep 2012 01:55:11 -0700 (PDT) Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B094039E8008; Sat, 15 Sep 2012 01:55:11 -0700 (PDT) Message-ID: <50544272.2020602@cs.ucla.edu> Date: Sat, 15 Sep 2012 01:55:14 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <83sjaju5ca.fsf@gnu.org> <50543339.3090500@cs.ucla.edu> <83ligbu1uk.fsf@gnu.org> In-Reply-To: <83ligbu1uk.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) On 09/15/2012 01:28 AM, Eli Zaretskii wrote: > So what was the rationale of turning away from _setjmp Some POSIXish hosts lack _setjmp, but have sigsetjmp, and their longjmp implementations munge the signal masks. >> > Messups are trickier, because they involve rare race conditions. >> > They can occur if Emacs or a system call has set the signal mask to X, >> > but a longjump unexpectedly changes it to Y, where Y is not equal to X. > Why is that a messup? Because Emacs then continues with the wrong sigmask, which can cause signals to be blocked when they shouldn't be. From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 09:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Paul Eggert Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134770213728030 (code B ref 12446); Sat, 15 Sep 2012 09:43:01 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 09:42:17 +0000 Received: from localhost ([127.0.0.1]:34739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCotE-0007I3-Qi for submit@debbugs.gnu.org; Sat, 15 Sep 2012 05:42:17 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:60625) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCotB-0007Hu-SI for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 05:42:15 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAD00E00XI0TP00@a-mtaout20.012.net.il> for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 12:40:59 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAD00EUVXKBS420@a-mtaout20.012.net.il>; Sat, 15 Sep 2012 12:40:59 +0300 (IDT) Date: Sat, 15 Sep 2012 12:41:00 +0300 From: Eli Zaretskii In-reply-to: <50544066.1010205@cs.ucla.edu> X-012-Sender: halo1@inter.net.il Message-id: <83ipbftyhf.fsf@gnu.org> References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <505429CC.3000209@cs.ucla.edu> <83pq5nu2r5.fsf@gnu.org> <50544066.1010205@cs.ucla.edu> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 15 Sep 2012 01:46:30 -0700 > From: Paul Eggert > CC: 12446@debbugs.gnu.org, lekktu@gmail.com > > On 09/15/2012 01:08 AM, Eli Zaretskii wrote: > > As you might have expected, it broke the MS-Windows build. > > Sorry, no, as I wrote in my original bug report, I didn't > think it would break anything in the Microsoft builds. > I am not an expert on MS-Windows. Removing the inclusion of setjmp.h from the w32*.c files, like you did with all the rest, hardly requires any such expertise. > Since I don't know what the problem was in the MS-Windows build, I explained the problem in the comments in image.c, right before the change I made there. From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 09:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Paul Eggert Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134770232928331 (code B ref 12446); Sat, 15 Sep 2012 09:46:02 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 09:45:29 +0000 Received: from localhost ([127.0.0.1]:34744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCowL-0007Mu-8R for submit@debbugs.gnu.org; Sat, 15 Sep 2012 05:45:29 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:45554) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCowI-0007Mj-Q0 for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 05:45:27 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MAD00M00XONN200@a-mtaout22.012.net.il> for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 12:44:23 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAD00LCHXPYCRP0@a-mtaout22.012.net.il>; Sat, 15 Sep 2012 12:44:23 +0300 (IDT) Date: Sat, 15 Sep 2012 12:44:24 +0300 From: Eli Zaretskii In-reply-to: <50544272.2020602@cs.ucla.edu> X-012-Sender: halo1@inter.net.il Message-id: <83haqztybr.fsf@gnu.org> References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <83sjaju5ca.fsf@gnu.org> <50543339.3090500@cs.ucla.edu> <83ligbu1uk.fsf@gnu.org> <50544272.2020602@cs.ucla.edu> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 15 Sep 2012 01:55:14 -0700 > From: Paul Eggert > CC: 12446@debbugs.gnu.org, lekktu@gmail.com > > On 09/15/2012 01:28 AM, Eli Zaretskii wrote: > > So what was the rationale of turning away from _setjmp > > Some POSIXish hosts lack _setjmp, but have sigsetjmp, How did those hosts succeed to compile Emacs before your changes, then? > >> > Messups are trickier, because they involve rare race conditions. > >> > They can occur if Emacs or a system call has set the signal mask to X, > >> > but a longjump unexpectedly changes it to Y, where Y is not equal to X. > > Why is that a messup? > > Because Emacs then continues with the wrong sigmask, which can > cause signals to be blocked when they shouldn't be. longjmp restores the environment, including the signal mask, to what it was when setjmp was called. How can this restored mask be wrong, unless it was already wrong when setjmp was called? From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 10:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134770331429861 (code B ref 12446); Sat, 15 Sep 2012 10:02:02 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 10:01:54 +0000 Received: from localhost ([127.0.0.1]:34784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCpCD-0007la-FQ for submit@debbugs.gnu.org; Sat, 15 Sep 2012 06:01:54 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:34314) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCpCB-0007lS-6x for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 06:01:52 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 5B67EA60001; Sat, 15 Sep 2012 03:00:48 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7AwEl+1f7QQa; Sat, 15 Sep 2012 03:00:47 -0700 (PDT) Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id ACF8F39E800D; Sat, 15 Sep 2012 03:00:47 -0700 (PDT) Message-ID: <505451D2.2050307@cs.ucla.edu> Date: Sat, 15 Sep 2012 03:00:50 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <83sjaju5ca.fsf@gnu.org> <50543339.3090500@cs.ucla.edu> <83ligbu1uk.fsf@gnu.org> <50544272.2020602@cs.ucla.edu> <83haqztybr.fsf@gnu.org> In-Reply-To: <83haqztybr.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) On 09/15/2012 02:44 AM, Eli Zaretskii wrote: >> Some POSIXish hosts lack _setjmp, but have sigsetjmp, > > How did those hosts succeed to compile Emacs before your changes, then? They used setjmp, which meant they were slower and had some (rare) race conditions that caused problems. > longjmp restores the environment, including the signal mask, to what > it was when setjmp was called. No, sometimes it does, sometimes it doesn't. It depends on the platform. If you want the signal mask restored portably, you have to do it some other way, by using siglongjmp or pthread_sigmask or something like that. From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 10:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134770367230414 (code B ref 12446); Sat, 15 Sep 2012 10:08:02 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 10:07:52 +0000 Received: from localhost ([127.0.0.1]:34805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCpHz-0007uV-PN for submit@debbugs.gnu.org; Sat, 15 Sep 2012 06:07:52 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:34564) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCpHx-0007uO-Q1 for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 06:07:50 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 4045439E8013; Sat, 15 Sep 2012 03:06:47 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E13q768WuMmk; Sat, 15 Sep 2012 03:06:46 -0700 (PDT) Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id CFA7539E800D; Sat, 15 Sep 2012 03:06:46 -0700 (PDT) Message-ID: <50545339.5050709@cs.ucla.edu> Date: Sat, 15 Sep 2012 03:06:49 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <505429CC.3000209@cs.ucla.edu> <83pq5nu2r5.fsf@gnu.org> <50544066.1010205@cs.ucla.edu> <83ipbftyhf.fsf@gnu.org> In-Reply-To: <83ipbftyhf.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) On 09/15/2012 02:41 AM, Eli Zaretskii wrote: > Removing the inclusion of setjmp.h from the w32*.c files, like you did > with all the rest, hardly requires any such expertise. I don't see why removing those inclusions would have fixed anything, or broken anything either. Since I assumed they didn't affect the build I left them alone. > I explained the problem in the comments in image.c Yes, thanks, I saw that, but I'm afraid that I still don't know exactly what the problem was. But if the problem is fixed now we needn't worry about it further. From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 10:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Paul Eggert Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.134770489732514 (code B ref 12446); Sat, 15 Sep 2012 10:29:01 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 10:28:17 +0000 Received: from localhost ([127.0.0.1]:34892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCpbl-0008SM-Fp for submit@debbugs.gnu.org; Sat, 15 Sep 2012 06:28:17 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:37393) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCpbj-0008SB-5W for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 06:28:15 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAD00F00ZOU9500@a-mtaout20.012.net.il> for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 13:27:11 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAD00FPEZPB1960@a-mtaout20.012.net.il>; Sat, 15 Sep 2012 13:27:11 +0300 (IDT) Date: Sat, 15 Sep 2012 13:27:13 +0300 From: Eli Zaretskii In-reply-to: <505451D2.2050307@cs.ucla.edu> X-012-Sender: halo1@inter.net.il Message-id: <83a9wrtwce.fsf@gnu.org> References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <83sjaju5ca.fsf@gnu.org> <50543339.3090500@cs.ucla.edu> <83ligbu1uk.fsf@gnu.org> <50544272.2020602@cs.ucla.edu> <83haqztybr.fsf@gnu.org> <505451D2.2050307@cs.ucla.edu> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 15 Sep 2012 03:00:50 -0700 > From: Paul Eggert > CC: 12446@debbugs.gnu.org, lekktu@gmail.com > > > longjmp restores the environment, including the signal mask, to what > > it was when setjmp was called. > > No, sometimes it does, sometimes it doesn't. > It depends on the platform. If you want the signal mask > restored portably, you have to do it some other way, by using > siglongjmp or pthread_sigmask or something like that. Yes, but from your description of the "messup" it sounds like _not_ restoring the signal mask will cause the trouble. After your changes, we never restore the signal mask, because sigsetjmp is called with its second argument zero. From unknown Mon Jun 23 07:53:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12446: port better to POSIX hosts lacking _setjmp Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Sep 2012 20:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: lekktu@gmail.com, 12446@debbugs.gnu.org Received: via spool by 12446-submit@debbugs.gnu.org id=B12446.13477408335871 (code B ref 12446); Sat, 15 Sep 2012 20:28:02 +0000 Received: (at 12446) by debbugs.gnu.org; 15 Sep 2012 20:27:13 +0000 Received: from localhost ([127.0.0.1]:35825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCyxM-0001We-QB for submit@debbugs.gnu.org; Sat, 15 Sep 2012 16:27:12 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:50174) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCyxL-0001WX-0v for 12446@debbugs.gnu.org; Sat, 15 Sep 2012 16:27:11 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 0E2F739E8015; Sat, 15 Sep 2012 13:26:06 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QvzDQQrcT-C8; Sat, 15 Sep 2012 13:26:05 -0700 (PDT) Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8931239E8014; Sat, 15 Sep 2012 13:26:05 -0700 (PDT) Message-ID: <5054E45D.8000006@cs.ucla.edu> Date: Sat, 15 Sep 2012 13:26:05 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 References: <50538925.3010608@cs.ucla.edu> <83txv0tkho.fsf@gnu.org> <5053A177.1020608@cs.ucla.edu> <83sjaju5ca.fsf@gnu.org> <50543339.3090500@cs.ucla.edu> <83ligbu1uk.fsf@gnu.org> <50544272.2020602@cs.ucla.edu> <83haqztybr.fsf@gnu.org> <505451D2.2050307@cs.ucla.edu> <83a9wrtwce.fsf@gnu.org> In-Reply-To: <83a9wrtwce.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) On 09/15/2012 03:27 AM, Eli Zaretskii wrote: > Yes, but from your description of the "messup" it sounds like _not_ > restoring the signal mask will cause the trouble. Yes, the point is that the longjmp would get in the way of Emacs restoring the signal mask, because the longjmp would set the signal mask in an undesirable way. > After your changes, we never restore the signal mask And that's what we want. On platforms that have _setjmp, Emacs already uses _setjmp so that the corresponding _longjmp does not restore the signal mask, which is what we want. The changes merely adjust the behavior to do the same thing on platforms that have sigsetjmp but not _setjmp.