public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114436] New: #pragma GCC system_header vs. _Pragma("GCC system_header")
@ 2024-03-22 18:18 finke at cognitec dot com
  2024-03-22 18:28 ` [Bug preprocessor/114436] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: finke at cognitec dot com @ 2024-03-22 18:18 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-23 21:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22 18:18 [Bug c++/114436] New: #pragma GCC system_header vs. _Pragma("GCC system_header") finke at cognitec dot com
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

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).