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