From a55a0483c939b7e0cc8b85d96a2fe8ac3fc6fb41 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 31 May 2022 01:19:32 -0700 Subject: [PATCH] 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 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; -- 2.39.2