From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 39F393858D28; Fri, 22 Mar 2024 18:18:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39F393858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711131507; bh=AALoHeLKnbYWiIEE4cjyOUQ0h6gnx9kIrqQFDaf5ECs=; h=From:To:Subject:Date:From; b=FaPp6ykNt2mZvzTPuCvhDlUA53fHX4K62+CFcJOVc6JU13dCHfSP7xdfAoYcDmlgs lBt58NdU7CmKV73lb0eik6rKXNVmonRheB0DVGqfE8CLxbo5i9IZSYqyZtBTcuMwi1 h7k0QAUvyCcS1PCbi9+dCPbavdYxy//6Xts4IUgo= From: "finke at cognitec dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114436] New: #pragma GCC system_header vs. _Pragma("GCC system_header") Date: Fri, 22 Mar 2024 18:18:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: finke at cognitec dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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=3D114436 Bug ID: 114436 Summary: #pragma GCC system_header vs. _Pragma("GCC system_header") Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: finke at cognitec dot com Target Milestone: --- Created attachment 57784 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57784&action=3Dedit code snippet When using the _Pragma operator instead of the #pragma directive for "GCC system_header", a different behavior can be observed: Warnings in included header files are not being ignored as it is the case w= ith the #pragma directive. The attached code snippet does emit an error when compiled with=20 "g++ -Werror=3Dunused-parameter pragma.cc" The expectation would be, that it compiles without error (clang is compilin= g it without error). gcc versions tested: 4.8.5 & 13.2.1 Output from compiler: In file included from pragma.h:10:0, from pragma.cc:1: third_party.h:4:13: error: unused parameter 'force_unused_warning' [-Werror=3Dunused-parameter] inline void foo( int force_unused_warning) { ^ cc1plus: some warnings being treated as errors=