From 8ece583aa00ef1e5b2b80bfbcdad42e6e9178da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= Date: Tue, 29 Nov 2022 00:41:27 +0100 Subject: [PATCH] Fix push/pop mismatch Without this, perlhead.swg does `#pragma GCC diagnostic pop` if `__GNUC__ >= 10` - without any prior `#pragma GCC diagnostic push`. There's also a mismatch between the conditions that trigger `#pragma GCC diagnostic ignored` (where the `push` should be) and the attempt to `#pragma GCC diagnostic pop`. --- CHANGES.current | 3 +++ Lib/perl5/perlhead.swg | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CHANGES.current b/CHANGES.current index 82c6dbee8..417bca656 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/ Version 4.2.0 (in progress) =========================== +2022-11-29: bero + Fix mismatch between #pragma GCC diagnostic push and pop statements + 2022-11-26: wsfulton #2449 Fix undefined behaviour in ccache-swig calculating md4 hashes and possibly also handling errors when CCACHE_CPP2 is set. diff --git a/Lib/perl5/perlhead.swg b/Lib/perl5/perlhead.swg index 773adee92..11ea50a9e 100644 --- a/Lib/perl5/perlhead.swg +++ b/Lib/perl5/perlhead.swg @@ -7,6 +7,7 @@ extern "C" { #if __GNUC__ >= 10 #if defined(__cplusplus) +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wvolatile" #endif #endif @@ -16,8 +17,10 @@ extern "C" { #include "XSUB.h" #if __GNUC__ >= 10 +#if defined(__cplusplus) #pragma GCC diagnostic pop #endif +#endif /* PERL_REVISION was added in Perl 5.6. */ #if !defined PERL_REVISION || (PERL_REVISION-0 == 5 && PERL_VERSION-0 < 8)