https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91890
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Status|UNCONFIRMED |NEW Last reconfirmed| |2019-09-25 See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=55881 Ever confirmed|0 |1 --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- Confirmed. The diagnostic pragmas don't work very well for the middle-end warnings (e.g., with inlining, as discussed in bug 55881). In this test case, moving the #pragma GCC diagnostic ignored above the strcpy calls does the trick. I haven't looked into why. Something similar was reported in bug 66099. Manu had some ideas for how to make it work more reliably but I haven't had the time to work on it and don't expect to for GCC 10.