https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115913
--- Comment #8 from Lewis Hyatt <lhyatt at gcc dot gnu.org> --- I think they are for different things, push_options/pop_options is for saving and restoring the command line flags that get implied from switching optimization levels or target pragmas, while diagnostic pragmas are for turning and and off warnings flags. So I guess another alternative to the patch I posted would be, #pragma GCC pop_options could ignore all warnings-related options when doing its checking? I'm not sure if it was intentional that it wanted to check those or not.