Within gthr-vxworks.h, we prevent C++ errors from missing
declarations in some system headers by prepending their inclusion
with a

    #pragma GCC diagnostic ignored "-Wstrict-prototypes"

But Wstrict-prototypes is internally registered as valid for
C/ObjC only, not C++, and this trick in turn triggers a Wpragma
warning with -Wsystem-headers.

This change just arranges to ignore the secondary warning locally.

We have been using this for a while with gcc-11 based toolchains,
where the only effect was the intended disappearance of a test failure
observed on g++.dg/warn/Wstringop-overflow-6.C.

Sanity checked with a build + basic testing with a gcc-12
compiler, then a mainline build for arm-vxworks7r2.

Cheers

Olivier

2021-02-03  Olivier Hainque  <hain...@adacore.com>

        * config/gthr-vxworks.h: Prevent Wpragma warning for the
        pragma diagnostics on Wstrict-prototypes.

Attachment: 0010-Prevent-secondary-warning-from-diagnostic-tweak-in-g.patch
Description: Binary data


Reply via email to