diff options
| author | Paul Eggert | 2024-08-17 11:09:17 -0700 |
|---|---|---|
| committer | Paul Eggert | 2024-08-17 11:10:20 -0700 |
| commit | 4f1987cf77bc8e0f0180a665b3cab732021e25ab (patch) | |
| tree | 4538e6442617e21895137674b25972218c5c92e1 /src | |
| parent | c4beb9a4bdade735e4841dcbe0140e8c0b3efd8a (diff) | |
| download | emacs-4f1987cf77bc8e0f0180a665b3cab732021e25ab.tar.gz emacs-4f1987cf77bc8e0f0180a665b3cab732021e25ab.zip | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 0d3506bc59b..0992fab653b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2752,7 +2752,7 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2752 | it *must not* be in effect when we call redisplay. */ | 2752 | it *must not* be in effect when we call redisplay. */ |
| 2753 | 2753 | ||
| 2754 | specpdl_ref jmpcount = SPECPDL_INDEX (); | 2754 | specpdl_ref jmpcount = SPECPDL_INDEX (); |
| 2755 | Lisp_Object volatile c_volatile; | 2755 | Lisp_Object volatile c_volatile = c; |
| 2756 | if (sys_setjmp (local_getcjmp)) | 2756 | if (sys_setjmp (local_getcjmp)) |
| 2757 | { | 2757 | { |
| 2758 | c = c_volatile; | 2758 | c = c_volatile; |
| @@ -2800,7 +2800,6 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2800 | goto non_reread; | 2800 | goto non_reread; |
| 2801 | } | 2801 | } |
| 2802 | 2802 | ||
| 2803 | c_volatile = c; | ||
| 2804 | #if GCC_LINT && __GNUC__ && !__clang__ | 2803 | #if GCC_LINT && __GNUC__ && !__clang__ |
| 2805 | /* This useless assignment pacifies GCC 14.2.1 x86-64 | 2804 | /* This useless assignment pacifies GCC 14.2.1 x86-64 |
| 2806 | <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21161>. */ | 2805 | <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21161>. */ |