From: Paul Eggert Date: Sat, 17 Aug 2024 18:09:17 +0000 (-0700) Subject: Pacify GCC 14 on recent read_char change X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6a63485ffb4b921205d7038d58d89ebbcd426159;p=emacs.git Pacify GCC 14 on recent read_char change * src/keyboard.c (read_char): Initialize c_volatile before calling setjmp. Although not necessary for correctness, and not needed for gcc 14.2.1 20240801 (Red Hat 14.2.1-1) on x86-64 when built with --enable-gcc-warnings, some GCC 14 x86-64 configurations issue a false positive without this change. Problem reported by Andrea Corallo in: https://lists.gnu.org/r/emacs-devel/2024-08/msg00620.html and fix suggested by Pip Cet in: https://lists.gnu.org/r/emacs-devel/2024-08/msg00627.html (cherry picked from commit 4f1987cf77bc8e0f0180a665b3cab732021e25ab) --- diff --git a/src/keyboard.c b/src/keyboard.c index 6438e9cacb4..909c97774a4 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2752,7 +2752,7 @@ read_char (int commandflag, Lisp_Object map, it *must not* be in effect when we call redisplay. */ specpdl_ref jmpcount = SPECPDL_INDEX (); - Lisp_Object volatile c_volatile; + Lisp_Object volatile c_volatile = c; if (sys_setjmp (local_getcjmp)) { c = c_volatile; @@ -2800,7 +2800,6 @@ read_char (int commandflag, Lisp_Object map, goto non_reread; } - c_volatile = c; #if GCC_LINT && __GNUC__ && !__clang__ /* This useless assignment pacifies GCC 14.2.1 x86-64 . */