From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#57208: 29.0.50; Uninitialized compilation warnings in xterm.c Date: Sun, 14 Aug 2022 18:57:41 +0300 Message-ID: <87bksmom16.fsf@tcd.ie> Reply-To: "Basil L. Contovounesios" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14349"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Po Lu To: 57208@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 14 17:58:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNG0A-0003Sw-Js for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 17:58:10 +0200 Original-Received: from localhost ([::1]:42404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNG09-0002GU-HY for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 11:58:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNG02-0002Fw-Qx for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 11:58:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49821) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNG02-0007oF-Fw for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 11:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNG02-0000Uj-AA; Sun, 14 Aug 2022 11:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: luangruo@yahoo.com, bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Aug 2022 15:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 57208 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Po Lu Original-Received: via spool by submit@debbugs.gnu.org id=B.16604926731883 (code B ref -1); Sun, 14 Aug 2022 15:58:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Aug 2022 15:57:53 +0000 Original-Received: from localhost ([127.0.0.1]:39570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNFzt-0000UI-Aq for submit@debbugs.gnu.org; Sun, 14 Aug 2022 11:57:53 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNFzp-0000U9-9K for submit@debbugs.gnu.org; Sun, 14 Aug 2022 11:57:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNFzp-0002Ek-3m for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 11:57:49 -0400 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:37644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNFzm-0007nk-SW for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 11:57:48 -0400 Original-Received: by mail-wm1-x336.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso6758279wma.2 for ; Sun, 14 Aug 2022 08:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc; bh=y7Uy/tr7PEEW0GTzYSEm86o5SWFkkOCFzLbaRO4t79M=; b=VoC8UeeIiAm6b9zdPdRBJ3Y+2r71Leg2gQcvKDV6yg+vaL75fPmILg5iopf4ZENVB+ fgbnWceYHfVb/68hvDTedwMDYnvzZ6pxn7pg9cJICicN0O91gBAcqNqWPztwZZxn1m8t /bGThvLQc9dfnDthPnBVOeqpTJZSXuL9L5eVr3/0x5IhMEigsmWv5sM7BHQ71/xre5ct kBPakHoBDUwO5ylEPP68xJxOVRniARu+igh6ncjEIbTyHCGIEr7uTFwNoV5svKsLqLRn 5IIgF3RBdZGXvLHTDkoDJbbZYAqMHDODZKT6rWrFuchyNGq00MERmHQ8bja5EIBSNCEt Qakg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc; bh=y7Uy/tr7PEEW0GTzYSEm86o5SWFkkOCFzLbaRO4t79M=; b=hc3T7fqod7INR5XTUQN2NFN8pxTPCOX7ycSwAXelxO+l1OzU4m3Sxnt2ribjGOCUAJ 3qD+DvhsC6XGLF9j+FaGIvYBGUiTB+Q9ZJHVZdtsrXU3NeNpAPv444/c4hMGz3OYJpLk tqRznll4Q0MRLKUDE8ZeJ5uflTmUnSmesy94i+LihhQ58IbCiP8CWDEkwi/JPcP8Vn72 u51k0X/5JfS4r/RqJ/wvejpGez6sZGxKPdYiQH6fGwYi7b+F2WqdukYj/VgYxTHlftLO JVYxWhWHY2zQLkBF5RE3fDJ+jMuHBV31WnAq5PWlv8ZUXo6SSqrdbXQh+uE4ZvfK9ziS JHtg== X-Gm-Message-State: ACgBeo1AYfFyZgH/AAKT/pmfIhxu20GhgXh2+7u8xHQTqmqEBMffAni2 6nJEkuw6S7EMxUZFHdbuOIMh/yiesxftdg== X-Google-Smtp-Source: AA6agR7v7tUOE0q1BA64Bnho4wS9wI40fgNkgWcnpRb30oHNvflFcQyguzYfDYkuKoOKJfVoUgtT/g== X-Received: by 2002:a05:600c:1993:b0:3a4:c0a9:5b6f with SMTP id t19-20020a05600c199300b003a4c0a95b6fmr7889948wmq.79.1660492664582; Sun, 14 Aug 2022 08:57:44 -0700 (PDT) Original-Received: from localhost ([2a02:587:322a:4bea:c3bc:c7ac:e79d:a903]) by smtp.gmail.com with ESMTPSA id bd20-20020a05600c1f1400b003a5260b8392sm8639751wmb.23.2022.08.14.08.57.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Aug 2022 08:57:43 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=contovob@tcd.ie; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:239657 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Severity: minor Tags: patch Compiling with GCC 12 and -Og, I get the following -Wmaybe-uninitialized warnings: xterm.c: In function =E2=80=98x_dnd_free_toplevels=E2=80=99: xterm.c:2918:17: warning: =E2=80=98dpy=E2=80=99 may be used uninitialized [= -Wmaybe-uninitialized] 2918 | dpyinfo =3D x_display_info_for_display (dpy); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ xterm.c:2853:12: note: =E2=80=98dpy=E2=80=99 was declared here 2853 | Display *dpy; | ^~~ xterm.c: In function =E2=80=98xm_setup_dnd_targets=E2=80=99: xterm.c:2284:21: warning: =E2=80=98recs=E2=80=99 may be used uninitialized = [-Wmaybe-uninitialized] 2284 | recs[header.target_list_count - 1]->targets[i] =3D = targets_sorted[i]; | ^ xterm.c:2112:26: note: =E2=80=98recs=E2=80=99 was declared here 2112 | xm_targets_table_rec **recs; | ^~~~ They're bogus, right? Is it okay to silence them as follows? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Pacify-maybe-uninitialized-warnings-in-xterm.c.patch >From d14b6fa375ce7a9eded5d0aeae52c8eac893e4de Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sun, 14 Aug 2022 18:33:45 +0300 Subject: [PATCH] Pacify maybe-uninitialized warnings in xterm.c * src/xterm.c (xm_setup_dnd_targets, x_dnd_free_toplevels): Initialize two pointers as NULL early, to pacify GCC 12 -Wmaybe-uninitialized warnings when compiling with -Og. --- src/xterm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 6cf44e162b..e7ee5fd32e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2109,7 +2109,7 @@ xm_setup_dnd_targets (struct x_display_info *dpyinfo, int rc, actual_format, idx; bool had_errors; xm_targets_table_header header; - xm_targets_table_rec **recs; + xm_targets_table_rec **recs = NULL; xm_byte_order byteorder; uint8_t *data; ptrdiff_t total_bytes, total_items, i; @@ -2850,7 +2850,7 @@ x_dnd_free_toplevels (bool display_alive) Window *destroy_windows UNINIT; unsigned long *prev_masks UNINIT; specpdl_ref count; - Display *dpy; + Display *dpy = NULL; struct x_display_info *dpyinfo; if (!x_dnd_toplevels) -- 2.35.1 --=-=-= Content-Type: text/plain Thanks, -- Basil In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2022-08-14 built on tia Repository revision: 1d3fe256907d5e78a4acedd194e55db8ab952952 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure CC=gcc-12 'CFLAGS=-Og -ggdb3' --config-cache --prefix=/home/blc/.local --enable-checking=structs --with-file-notification=yes --with-x-toolkit=lucid --with-x' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_IE.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix --=-=-=--