public inbox for
help / color / mirror / Atom feed
* [gcc r13-3017] Prevent secondary warning from diagnostic tweak in gthr-vxworks.h
@ 2022-10-02  9:13 Olivier Hainque
  0 siblings, 0 replies; only message in thread
From: Olivier Hainque @ 2022-10-02  9:13 UTC (permalink / raw)
  To: gcc-cvs

commit r13-3017-g372044a67ec8346f4f308c5fe79d9e1cb6e7e6c6
Author: Olivier Hainque <>
Date:   Thu Feb 3 15:57:32 2022 +0000

    Prevent secondary warning from diagnostic tweak in gthr-vxworks.h
    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  <>
            * config/gthr-vxworks.h: Prevent Wpragma warning for the
            pragma diagnostics on Wstrict-prototypes.

 libgcc/config/gthr-vxworks.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libgcc/config/gthr-vxworks.h b/libgcc/config/gthr-vxworks.h
index 9861a11511a..31c4b9f2557 100644
--- a/libgcc/config/gthr-vxworks.h
+++ b/libgcc/config/gthr-vxworks.h
@@ -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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-02  9:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02  9:13 [gcc r13-3017] Prevent secondary warning from diagnostic tweak in gthr-vxworks.h Olivier Hainque

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).