From 7e871dcd27bdb827573ca97e609632e178e76f64 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 3 Oct 2021 17:52:04 -0700 Subject: [PATCH] Remove encode_terminal_code UNINITs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/term.c (encode_terminal_code): Clarify by removing a couple of UNINITs and testing the local variable ‘cmp’ instead of retesting src->u.cmp.automatic. This pacifies gcc 11.2.1 -Wanalyzer-null-dereference. --- src/term.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/term.c b/src/term.c index 7d9fe8cee30..0858f816851 100644 --- a/src/term.c +++ b/src/term.c @@ -549,13 +549,14 @@ encode_terminal_code (struct glyph *src, int src_len, { if (src->type == COMPOSITE_GLYPH) { - struct composition *cmp UNINIT; - Lisp_Object gstring UNINIT; + struct composition *cmp; + Lisp_Object gstring; int i; nbytes = buf - encode_terminal_src; if (src->u.cmp.automatic) { + cmp = NULL; gstring = composition_gstring_from_id (src->u.cmp.id); required = src->slice.cmp.to - src->slice.cmp.from + 1; } @@ -575,7 +576,7 @@ encode_terminal_code (struct glyph *src, int src_len, buf = encode_terminal_src + nbytes; } - if (src->u.cmp.automatic) + if (!cmp) for (i = src->slice.cmp.from; i <= src->slice.cmp.to; i++) { Lisp_Object g = LGSTRING_GLYPH (gstring, i); -- 2.39.5