public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/89038] #pragma GCC diagnostic ignored "-Wunknown-pragmas" does not work
[not found] <bug-89038-4@http.gcc.gnu.org/bugzilla/>
@ 2023-10-17 17:11 ` argothiel at interia dot pl
2023-10-18 16:57 ` lhyatt at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: argothiel at interia dot pl @ 2023-10-17 17:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89038
argothiel <argothiel at interia dot pl> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |argothiel at interia dot pl
--- Comment #5 from argothiel <argothiel at interia dot pl> ---
This issue still occurs in GCC 13.2 despite fixing PR53431:
https://godbolt.org/z/6xon1cTfh
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/89038] #pragma GCC diagnostic ignored "-Wunknown-pragmas" does not work
[not found] <bug-89038-4@http.gcc.gnu.org/bugzilla/>
2023-10-17 17:11 ` [Bug c++/89038] #pragma GCC diagnostic ignored "-Wunknown-pragmas" does not work argothiel at interia dot pl
@ 2023-10-18 16:57 ` lhyatt at gcc dot gnu.org
2023-10-19 12:45 ` mpolacek at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: lhyatt at gcc dot gnu.org @ 2023-10-18 16:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89038
Lewis Hyatt <lhyatt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lhyatt at gcc dot gnu.org
Status|RESOLVED |NEW
Resolution|DUPLICATE |---
--- Comment #6 from Lewis Hyatt <lhyatt at gcc dot gnu.org> ---
-Wunknown-pragmas is a special case because it is emitted during preprocessing,
but not directly by the preprocessor (rather from a callback in C frontend), so
in the options file, it is not tagged as a preprocessor warning, and hence
wasn't fixed by the mechanism introduced for PR53431.
I'll submit a patch shortly:
diff --git a/gcc/c-family/c-pragma.cc b/gcc/c-family/c-pragma.cc
index 293311dd4ce..98dfb0f108b 100644
--- a/gcc/c-family/c-pragma.cc
+++ b/gcc/c-family/c-pragma.cc
@@ -963,7 +963,8 @@ handle_pragma_diagnostic_impl ()
/* option_string + 1 to skip the initial '-' */
unsigned int option_index = find_opt (data.option_str + 1, lang_mask);
- if (early && !c_option_is_from_cpp_diagnostics (option_index))
+ if (early && !(c_option_is_from_cpp_diagnostics (option_index)
+ || option_index == OPT_Wunknown_pragmas))
return;
if (option_index == OPT_SPECIAL_unknown)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/89038] #pragma GCC diagnostic ignored "-Wunknown-pragmas" does not work
[not found] <bug-89038-4@http.gcc.gnu.org/bugzilla/>
2023-10-17 17:11 ` [Bug c++/89038] #pragma GCC diagnostic ignored "-Wunknown-pragmas" does not work argothiel at interia dot pl
2023-10-18 16:57 ` lhyatt at gcc dot gnu.org
@ 2023-10-19 12:45 ` mpolacek at gcc dot gnu.org
2023-10-19 13:11 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-10-19 12:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89038
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fix by Lewis:
https://gcc.gnu.org/pipermail/gcc-patches/2023-October/633508.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/89038] #pragma GCC diagnostic ignored "-Wunknown-pragmas" does not work
[not found] <bug-89038-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2023-10-19 12:45 ` mpolacek at gcc dot gnu.org
@ 2023-10-19 13:11 ` cvs-commit at gcc dot gnu.org
2023-10-19 16:59 ` cvs-commit at gcc dot gnu.org
2023-10-19 17:01 ` lhyatt at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-10-19 13:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89038
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Lewis Hyatt <lhyatt@gcc.gnu.org>:
https://gcc.gnu.org/g:19cc4b9d74940f29c961e2a5a8b1fa84992d3d30
commit r14-4748-g19cc4b9d74940f29c961e2a5a8b1fa84992d3d30
Author: Lewis Hyatt <lhyatt@gmail.com>
Date: Wed Oct 18 12:37:08 2023 -0400
c++: Make -Wunknown-pragmas controllable by #pragma GCC diagnostic
[PR89038]
As noted on the PR, commit r13-1544, the fix for PR53431, did not handle
the specific case of -Wunknown-pragmas, because that warning is issued
during preprocessing, but not by libcpp directly (it comes from the
cb_def_pragma callback). Address that by handling this pragma in
addition to libcpp pragmas during the early pragma handler.
gcc/c-family/ChangeLog:
PR c++/89038
* c-pragma.cc (handle_pragma_diagnostic_impl): Handle
-Wunknown-pragmas during early processing.
gcc/testsuite/ChangeLog:
PR c++/89038
* c-c++-common/cpp/Wunknown-pragmas-1.c: New test.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/89038] #pragma GCC diagnostic ignored "-Wunknown-pragmas" does not work
[not found] <bug-89038-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2023-10-19 13:11 ` cvs-commit at gcc dot gnu.org
@ 2023-10-19 16:59 ` cvs-commit at gcc dot gnu.org
2023-10-19 17:01 ` lhyatt at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-10-19 16:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89038
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Lewis Hyatt
<lhyatt@gcc.gnu.org>:
https://gcc.gnu.org/g:7a1de35f9cdc13098375baa277496147be271dd3
commit r13-7964-g7a1de35f9cdc13098375baa277496147be271dd3
Author: Lewis Hyatt <lhyatt@gmail.com>
Date: Wed Oct 18 12:37:08 2023 -0400
c++: Make -Wunknown-pragmas controllable by #pragma GCC diagnostic
[PR89038]
As noted on the PR, commit r13-1544, the fix for PR53431, did not handle
the specific case of -Wunknown-pragmas, because that warning is issued
during preprocessing, but not by libcpp directly (it comes from the
cb_def_pragma callback). Address that by handling this pragma in
addition to libcpp pragmas during the early pragma handler.
gcc/c-family/ChangeLog:
PR c++/89038
* c-pragma.cc (handle_pragma_diagnostic_impl): Handle
-Wunknown-pragmas during early processing.
gcc/testsuite/ChangeLog:
PR c++/89038
* c-c++-common/cpp/Wunknown-pragmas-1.c: New test.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/89038] #pragma GCC diagnostic ignored "-Wunknown-pragmas" does not work
[not found] <bug-89038-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2023-10-19 16:59 ` cvs-commit at gcc dot gnu.org
@ 2023-10-19 17:01 ` lhyatt at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: lhyatt at gcc dot gnu.org @ 2023-10-19 17:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89038
Lewis Hyatt <lhyatt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #10 from Lewis Hyatt <lhyatt at gcc dot gnu.org> ---
Fixed for GCC 14 and 13.3.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-10-19 17:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-89038-4@http.gcc.gnu.org/bugzilla/>
2023-10-17 17:11 ` [Bug c++/89038] #pragma GCC diagnostic ignored "-Wunknown-pragmas" does not work argothiel at interia dot pl
2023-10-18 16:57 ` lhyatt at gcc dot gnu.org
2023-10-19 12:45 ` mpolacek at gcc dot gnu.org
2023-10-19 13:11 ` cvs-commit at gcc dot gnu.org
2023-10-19 16:59 ` cvs-commit at gcc dot gnu.org
2023-10-19 17:01 ` 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).