From: Paul Eggert Date: Sat, 17 Aug 2024 00:20:58 +0000 (-0700) Subject: Don’t ignore -Wclobbered in keyboard.c X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3bddbfe30e2ca06b48bb8fa16c5b15c581e032d6;p=emacs.git Don’t ignore -Wclobbered in keyboard.c This fixes Emacs bug#71744. * src/keyboard.c: Do not ignore -Wclobbered. (read_char): Fix violation of the C standard, where setjmp clobbered c. Fix suggested by Pip Cet in (cherry picked from commit a967efdd2a5b77e35657f9bdd7098b79241e3aa5) --- diff --git a/src/keyboard.c b/src/keyboard.c index 2b5b6eb3b8a..6e088372fcf 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -88,11 +88,6 @@ along with GNU Emacs. If not, see . */ #include TERM_HEADER #endif /* HAVE_WINDOW_SYSTEM */ -/* Work around GCC bug 54561. */ -#if GNUC_PREREQ (4, 3, 0) -# pragma GCC diagnostic ignored "-Wclobbered" -#endif - #ifdef WINDOWSNT char const DEV_TTY[] = "CONOUT$"; #else @@ -2522,7 +2517,7 @@ read_char (int commandflag, Lisp_Object map, Lisp_Object prev_event, bool *used_mouse_menu, struct timespec *end_time) { - Lisp_Object c; + Lisp_Object volatile c; sys_jmp_buf local_getcjmp; sys_jmp_buf save_jump; Lisp_Object tem, save;