From 3bddbfe30e2ca06b48bb8fa16c5b15c581e032d6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 16 Aug 2024 17:20:58 -0700 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20ignore=20-Wclobbered=20in=20keyb?= =?utf8?q?oard.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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) --- src/keyboard.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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; -- 2.39.2