https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91187
--- Comment #5 from Albert Astals Cid <aacid at kde dot org> --- (In reply to Harald van Dijk from comment #3) > If the header files cannot be modified, the -isystem command-line option > also causes included files to be treated as system headers where warnings > are suppressed. The thing is, this isn't happening. If you compile the attached main-glib.cpp with g++ -c -Wzero-as-null-pointer-constant main.cpp -isystem /usr/include/glib-2.0/ -isystem /usr/lib/glib-2.0/include i still get main.cpp: In function ‘GType poppler_annot_get_type()’: main.cpp:17:1: warning: zero as null pointer constant [-Wzero-as-null-pointer-constant] 17 | G_DEFINE_TYPE (PopplerAnnot, poppler_annot, G_TYPE_OBJECT) | ^~~~~~~~~~~~~