https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109912
Bug ID: 109912
Summary: #pragma GCC diagnostic ignored "-Wall" is ignored
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#pragma GCC diagnostic warning "-Wall"
#pragma GCC diagnostic ignored "-Wall"
int i = 0 | 1 & 2;
warning: suggest parentheses around arithmetic in operand of '|'
[-Wparentheses]
3 | int i = 0 | 1 & 2;
| ~~^~~
The expected behavior would be for `diagnostic ignored "-Wall"` to suppress all
the warnings that were enabled by `diagnostic warning "-Wall"`. If this isn't
possible, it would be good to emit a diagnostic that `diagnostic ignored
"-Wall"` has no effect.
Clang does support this and appears to have always done so.