[Bug preprocessor/103141] New: #pragma GCC diagnostic ignored "-Wno-deprecated-declarations" doesn't work

2021-11-08 Thread noah at revrobotics dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103141

Bug ID: 103141
   Summary: #pragma GCC diagnostic ignored
"-Wno-deprecated-declarations" doesn't work
   Product: gcc
   Version: 7.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
  Assignee: unassigned at gcc dot gnu.org
  Reporter: noah at revrobotics dot com
  Target Milestone: ---

When I have a header file that includes the line #pragma GCC diagnostic ignored
"-Wno-deprecated-declarations", this warning is printed: 

warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wno-deprecated-declarations"

When I replace no-deprecated-declarations with unused-result, that works.

It appears that GCC 11.2 still has this issue: https://godbolt.org/z/nYsPM9PT7

[Bug preprocessor/103141] #pragma GCC diagnostic ignored "-Wno-deprecated-declarations" doesn't work

2021-11-08 Thread noah at revrobotics dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103141

--- Comment #1 from Noah Andrews  ---
-Wno-deprecated also has this issue.

[Bug c/103141] #pragma GCC diagnostic ignored "-Wno-deprecated-declarations" doesn't work

2021-11-08 Thread noah at revrobotics dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103141

--- Comment #3 from Noah Andrews  ---
(In reply to Andrew Pinski from comment #2)
> you want:
> #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
> 
> Not the no- version

That's correct, thank you!