From 877be9098ee3ecc041216d39dbb20d0d044a46c0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 31 May 2022 01:19:32 -0700 Subject: [PATCH] Pacify GCC 12 -fanalyzer in x_popup_menu_1 * src/menu.c (x_popup_menu_1): Rework to avoid unnecessary initialization and test. This also pacifies GCC 12. --- src/menu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/menu.c b/src/menu.c index 398bf9329ff..eeb0c9a7e5b 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1118,7 +1118,7 @@ x_popup_menu_1 (Lisp_Object position, Lisp_Object menu) Lisp_Object title; const char *error_name = NULL; Lisp_Object selection = Qnil; - struct frame *f = NULL; + struct frame *f; Lisp_Object x, y, window; int menuflags = 0; specpdl_ref specpdl_count = SPECPDL_INDEX (); @@ -1269,9 +1269,9 @@ x_popup_menu_1 (Lisp_Object position, Lisp_Object menu) } } else - /* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME, + /* ??? Not really clean; should be Qwindow_or_framep but I don't want to make one now. */ - CHECK_WINDOW (window); + wrong_type_argument (Qwindowp, window); xpos += check_integer_range (x, (xpos < INT_MIN - MOST_NEGATIVE_FIXNUM -- 2.39.2