public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "finke at cognitec dot com" <gcc-bugzilla@gcc.gnu.org> 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 [thread overview] Message-ID: <bug-114436-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114436 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=57784&action=edit 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 with the #pragma directive. The attached code snippet does emit an error when compiled with "g++ -Werror=unused-parameter pragma.cc" The expectation would be, that it compiles without error (clang is compiling 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=unused-parameter] inline void foo( int force_unused_warning) { ^ cc1plus: some warnings being treated as errors
next reply other threads:[~2024-03-22 18:18 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-22 18:18 finke at cognitec dot com [this message] 2024-03-22 18:28 ` [Bug preprocessor/114436] " pinskia at gcc dot gnu.org 2024-03-22 19:36 ` lhyatt at gcc dot gnu.org 2024-03-23 21:36 ` lhyatt at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-114436-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).