https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95024
Bug ID: 95024 Summary: No way to pass "-Wno-error=..." with #pragma GCC diagnostic Product: gcc Version: 10.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: colomar.6.4.3 at gmail dot com Target Milestone: --- There is no way to disable `-Werror` for specific lines of code. I would use something like this: // I want errors about conversion here #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Werror=conversion" // I don't want errors about conversion here #pragma GCC diagnostic push // I want errors about conversion here