From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 53F3A3857C7C; Tue, 4 Oct 2022 22:35:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53F3A3857C7C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664922941; bh=x/Fb+mmi37rckk9vCbIVCjz5rgejbp2VS98KmWRygK0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QyNEMW/1N+UJCzEZJAz9TRctFgTbY1x0/vbKlRa4CAXXISnZRJWxElDXMfn+GPO1Y 1amZwgPEw55Rz5NMjkM+2MD/iiMUkbXlSJoRb6UNk7XB3W0/R/9CsC3ea6uqOoe564 rHFDuL01GSU+9exKTe6alhJiliTymUVJD5MfsqCY= From: "lhyatt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/83256] inconsistent _Pragma behavior in multi-line macros Date: Tue, 04 Oct 2022 22:35:40 +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: 8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: lhyatt at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED 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: bug_status resolution cc 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=3D83256 Lewis Hyatt changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED CC| |lhyatt at gcc dot gnu.org --- Comment #5 from Lewis Hyatt --- For the testcases in comment 2 and comment 4, the problem was the loss of m= acro tracking information for the _Pragma token, and r9-1926 (for PR69558) fixed that, resolving a large class of diagnostic _Pragma location problems inclu= ding these.=20 For the current PR's original testcase (attachment 42777), there are two separate issues combined together: -For -Wuninitialized, this was caused for both C and C++ by -Wuninitial= ized using the spelling location rather than the macro expansion location. It has been fixed recently (r13-2994) for GCC 13. That fix has so far not been backported but it would backport fine if someone wants it. -For -Wattribute-alias, this one is applicable only to C, since C++ iss= ues a hard error for this testcase rather than a warning. Note, to avoid potent= ial confusion, the testcase as posted does not fail, it is needed to remove the "struct s;" line to exhibit the problem. This was fixed by r13-1596 (for PR97498) and was the same issue. (That was the fact that in C, input_locati= on was often pointing to the start of the line.) This is backported to 10,11,12 branches already. It seems to me that the testcases added for the above three cases cover everything in this PR, so I am resolving it now.=