]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Prevent secondary warning from diagnostic tweak in gthr-vxworks.h
authorOlivier Hainque <hainque@adacore.com>
Thu, 3 Feb 2022 15:57:32 +0000 (15:57 +0000)
committerOlivier Hainque <hainque@adacore.com>
Sun, 2 Oct 2022 09:13:14 +0000 (09:13 +0000)
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.

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

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

libgcc/config/gthr-vxworks.h

index 9861a11511a838671abdfb24150dd6e6b0c5c50f..31c4b9f2557fbe94fe2c68f0d353f6e424c742db 100644 (file)
@@ -38,8 +38,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include <_vxworks-versions.h>
 
 /* Some VxWorks headers profusely use typedefs of a pointer to a function with
-   undefined number of arguments.  */
+   undefined number of arguments.  Arrange to ignore declaration errors in C++,
+   which is achievable by ignoring Wstrict-prototypes diagnostics even when the
+   option is registered as only valid for c/objc.  */
 #pragma GCC diagnostic push
+  #pragma GCC diagnostic ignored "-Wpragmas"
   #pragma GCC diagnostic ignored "-Wstrict-prototypes"
   #include <semLib.h>
 #pragma GCC diagnostic pop