[Bug tree-optimization/119388] [12/13/14/15 Regression] -isystem does not disable warnings coming from system headers
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 20 23:08:42 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119388
--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Giuseppe D'Angelo from comment #8)
> Well, that's a laudable goal, but I'm very afraid it'll just cause the
> corresponding warnings to be entirely disabled instead -- since in many
> cases the end-user can't upgrade the system header, nor the compiler
> version. And this exposes users to real bugs in their own code. :-(
You can disable specific warnings when including headers that are known to be
buggy but you can't upgrade.
For your compiler explorer demo:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#include <stuff.h>
#pragma GCC diagnostic pop
This is more targeted than "it's a system header, so ignore all its bugs".
More information about the Gcc-bugs
mailing list