]> git.eshelyaron.com Git - emacs.git/commitdiff
Don’t ignore -Wclobbered in keyboard.c
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 17 Aug 2024 00:20:58 +0000 (17:20 -0700)
committerEshel Yaron <me@eshelyaron.com>
Tue, 20 Aug 2024 14:08:54 +0000 (16:08 +0200)
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
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71744#38>

(cherry picked from commit a967efdd2a5b77e35657f9bdd7098b79241e3aa5)

src/keyboard.c

index 2b5b6eb3b8a7506b9738f3ec31497045f257b772..6e088372fcf63a500a50ab39c0f31cb881492f27 100644 (file)
@@ -88,11 +88,6 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #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;