From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8F0633858431; Fri, 29 Oct 2021 17:40:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F0633858431 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/91669] #pragma's and _Pragma's work but _Pragma's used in an equivalent macro don't Date: Fri, 29 Oct 2021 17:40:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 5.5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus 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: 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 Oct 2021 17:40:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91669 --- Comment #3 from Tobias Burnus --- Comparing the two inside handle_pragma_visibility: * the no-save-temps version has as 'loc' the line pointing to _Pragma(#__VA_ARGS__) * with -save-temps, 'loc' =3D=3D 'input_location'. But: control_warning_option is called with input_location and not 'loc', th= us that should not be the reason for the issue. * * * However, if one does a deep dive into update_effective_level_from_pragmas, = the difference seems to be only the column number. There is: if (!linemap_location_before_p (line_table, pragloc, loc)) continue; Without -save-temps, there is (with warnings + notes added for debugging): foo.c:29:1: warning: update_effective_level_from_pragmas - pragloc 29 | BX_retundef(}) | ^~~~~~~~~~~ foo.c:29:13: note: loc is here 29 | BX_retundef(}) | ^ thus loc > pragloc But -save-temps, i.e. working on the preprocessed input, there is: foo.c:29:9: warning: update_effective_level_from_pragmas - pragloc 29 | BX_retundef(}) | ^~~ foo.c:29:2: note: loc is here 29 | BX_retundef(}) | ^ That is: loc < pragloc=