From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B9CE1385C402; Fri, 30 Sep 2022 18:10:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9CE1385C402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664561429; bh=UvSQUI9nktOlyFmata7oy4Nr/Qu7Tq+tm2j4Qc/wD9Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ucPOVxnkdkDSZRUrOtrwu8TwH+hqZ1qzH0uPuAz0P1c6xIj1Jc0SxPbBvWhBngQ0v Rfv5gAzTXrsUiBk+y98HrbT6Pd3bybeOjCBPD8AoCjZG5HSOsT9D/QVozVYHsTKAhD dFGt4uFqUOZGm0g1Ro44LcvurPN9VCyknt99SSZc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/69543] [10/11/12/13 Regression] _Pragma does not apply within macro Date: Fri, 30 Sep 2022 18:10:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69543 --- Comment #21 from CVS Commits --- The master branch has been updated by Lewis Hyatt : https://gcc.gnu.org/g:b52b99b62df8fc9b3a3010cb0a8cf49bc35037f0 commit r13-2994-gb52b99b62df8fc9b3a3010cb0a8cf49bc35037f0 Author: Lewis Hyatt Date: Fri Sep 30 14:10:00 2022 -0400 diagnostics: Fix virtual location for -Wuninitialized [PR69543] Warnings issued for -Wuninitialized have been using the spelling locati= on of the problematic usage, discarding any information on the location of the macro expansion point if such usage was in a macro. This makes the warnings impossible to control reliably with #pragma GCC diagnostic, and also discards useful context in the diagnostic output. There seems to be no need to discard the virtual location information, so this patch fixes that. PR69543 was mostly about _Pragma issues which have been fixed for many years now. The PR remains open because two of the testcases added in response= to it still have xfails, but those xfails have nothing to do with _Pragma and rather just with the issue fixed by this patch, so the PR can be closed now as well. The other testcase modified here, pragma-diagnostic-2.c, was explicitly testing for the undesirable behavior that was xfailed in pr69543-3.c. I have adjusted that and also added a new testcase verifying all 3 types of warning that come from tree-ssa-uninit.cc get the proper location information n= ow. gcc/ChangeLog: PR preprocessor/69543 * tree-ssa-uninit.cc (warn_uninit): Stop stripping macro tracki= ng information away from the diagnostic location. (maybe_warn_read_write_only): Likewise. (maybe_warn_operand): Likewise. gcc/testsuite/ChangeLog: PR preprocessor/69543 * c-c++-common/pr69543-3.c: Remove xfail. * c-c++-common/pr69543-4.c: Likewise. * gcc.dg/cpp/pragma-diagnostic-2.c: Adjust test for new behavio= r. * c-c++-common/pragma-diag-16.c: New test.=