diff options
| author | Paul Eggert | 2022-05-12 17:01:10 -0700 |
|---|---|---|
| committer | Paul Eggert | 2022-05-12 17:03:55 -0700 |
| commit | 0f731c49e6a8ccf3aa4c30c3f8ca82ed0a2cefb7 (patch) | |
| tree | f675d5245b560aaaeae1c95f52df8ec882631d75 /src/term.c | |
| parent | 454caf858d92a87dc781bc35b421d5014a312bb9 (diff) | |
| download | emacs-0f731c49e6a8ccf3aa4c30c3f8ca82ed0a2cefb7.tar.gz emacs-0f731c49e6a8ccf3aa4c30c3f8ca82ed0a2cefb7.zip | |
Pacify GCC 12 in default developer build
This lets ‘./configure; make’ work on Fedora 36 x86-64 from a Git
checkout without generating false-alarm warnings.
* lib-src/etags.c (main): There appeared to be false alarm with
GCC 12. However, the code was wrong anyway, as it mishandled file
names containing "'" so fix that bug. This pacifies GCC.
(mercury_decl): Omit tests ‘s + pos != NULL’ that were apparently
intended to be ‘s[pos] != '\0'’ but which were miscoded to always
be true and which were mostly not needed anyway. In one place,
though, a test was needed, so fix that by using strchr instead.
* src/alloc.c (lisp_free) [!GC_MALLOC_CHECK]:
* src/term.c (Fsuspend_tty): Don’t look at a pointer after freeing
it, even just to test it for equality with some other pointer, as
this has undefined behavior in C and GCC 12 diagnoses this.
* src/dbusbind.c (xd_read_message_1): Rework the code a bit
so that it has fewer tests. This pacifies GCC 12 which was
complaining incorrectly about dereferencing a null pointer.
* src/intervals.c (copy_properties): Remove an eassume that should
no longer be needed even to pacify older GCCs, due to ...
* src/intervals.h (split_interval_left): ... this addition of
ATTRIBUTE_RETURNS_NONNULL to pacify a GCC 12 warning about
dereferencing a null pointer.
* src/regex-emacs.c (EXTEND_BUFFER): Use negative values rather
than auxiliary booleans to indicate null pointers. This pacifies
GCC 12 false alarms about using uninitialized variables.
* src/xdisp.c (clear_position): New function.
(append_space_for_newline, extend_face_to_end_of_line):
Use it to work around false alarms from GCC 12.
(display_and_set_cursor): Add an UNINIT to pacify GCC 12.
* src/xterm.c (x_draw_glyphless_glyph_string_foreground):
Defend against hypothetical bad code elsewhere;
this also pacifies GCC 12.
(x_term_init): Use fixed-size auto array rather than alloca,
as the array is small; this also pacifies GCC 12.
Diffstat (limited to 'src/term.c')
| -rw-r--r-- | src/term.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/term.c b/src/term.c index bad1127c93b..3bea621dbda 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -2287,9 +2287,9 @@ A suspended tty may be resumed by calling `resume-tty' on it. */) | |||
| 2287 | delete_keyboard_wait_descriptor (fileno (f)); | 2287 | delete_keyboard_wait_descriptor (fileno (f)); |
| 2288 | 2288 | ||
| 2289 | #ifndef MSDOS | 2289 | #ifndef MSDOS |
| 2290 | fclose (f); | ||
| 2291 | if (f != t->display_info.tty->output) | 2290 | if (f != t->display_info.tty->output) |
| 2292 | fclose (t->display_info.tty->output); | 2291 | fclose (t->display_info.tty->output); |
| 2292 | fclose (f); | ||
| 2293 | #endif | 2293 | #endif |
| 2294 | 2294 | ||
| 2295 | t->display_info.tty->input = 0; | 2295 | t->display_info.tty->input = 0; |