From: Paul Eggert Date: Tue, 31 May 2022 08:19:32 +0000 (-0700) Subject: Pacify GCC 12 -fanalyzer in x_popup_menu_1 X-Git-Tag: emacs-29.0.90~1910^2~319^2~9 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=877be9098ee3ecc041216d39dbb20d0d044a46c0;p=emacs.git 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. --- 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