From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 18BFE3857C7A; Fri, 29 Jan 2021 00:49:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18BFE3857C7A From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/98871] Cannot silence -Wmaybe-uninitialized at declaration site Date: Fri, 29 Jan 2021 00:49:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component cf_reconfirmed_on see_also everconfirmed keywords cc bug_status blocked Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 00:49:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98871 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c |middle-end Last reconfirmed| |2021-01-29 See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D98465, | |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D98512 Ever confirmed|0 |1 Keywords| |diagnostic CC| |msebor at gcc dot gnu.org Status|UNCONFIRMED |NEW Blocks| |24639 --- Comment #2 from Martin Sebor --- Confirmed. The root cause of the problem is that the #pragma diagnostic suppression machinery consider only one location but that location may be different depending on the warning and depending on inlining. For some warnings it's the location of the call site into which the problem statement has been inlined. For others it might be the original location of the statement itself. -Wuninitialized and -Wmaybe-uninitialized happen to fall into the first category. The solution I posted for pr98465 and pr98512 lets it consider both (or all locations along the inlining stack) and, with an minor extension, makes the suppression work in this case as well. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D24639 [Bug 24639] [meta-bug] bug to track all Wuninitialized issues=