emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a55a0483c9 11/11: Pacify GCC 12 in x_get_current_wm_state


From: Paul Eggert
Subject: master a55a0483c9 11/11: Pacify GCC 12 in x_get_current_wm_state
Date: Tue, 31 May 2022 04:27:01 -0400 (EDT)

branch: master
commit a55a0483c939b7e0cc8b85d96a2fe8ac3fc6fb41
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Pacify GCC 12 in x_get_current_wm_state
    
    * src/xterm.c (x_get_current_wm_state): When lint checking,
    initialize reply_data to a non-null dummy value instead of to a
    null one.  This pacifies GCC 12 -Wanalyzer-null-dereference.
---
 src/xterm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index e9c38ae484..0ebabdccaf 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -22468,15 +22468,20 @@ x_get_current_wm_state (struct frame *f,
 #ifdef USE_XCB
   xcb_get_property_cookie_t prop_cookie;
   xcb_get_property_reply_t *prop;
-  xcb_atom_t *reply_data UNINIT;
+  typedef xcb_atom_t reply_data_object;
 #else
   Display *dpy = FRAME_X_DISPLAY (f);
   unsigned long bytes_remaining;
   int rc, actual_format;
   Atom actual_type;
   unsigned char *tmp_data = NULL;
-  Atom *reply_data UNINIT;
+  typedef Atom reply_data_object;
 #endif
+  reply_data_object *reply_data;
+# if defined GCC_LINT || defined lint
+  reply_data_object reply_data_dummy;
+  reply_data = &reply_data_dummy;
+# endif
 
   *sticky = false;
   *size_state = FULLSCREEN_NONE;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]