From: Paul Eggert Date: Tue, 31 May 2022 08:19:32 +0000 (-0700) Subject: Pacify GCC 12 in x_get_current_wm_state X-Git-Tag: emacs-29.0.90~1910^2~319^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a55a0483c939b7e0cc8b85d96a2fe8ac3fc6fb41;p=emacs.git 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. --- diff --git a/src/xterm.c b/src/xterm.c index e9c38ae4847..0ebabdccafd 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;