From 8355c1611d84251c466f7fd27dcede31cf1a6402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 9 Feb 2021 19:05:05 +0100 Subject: [PATCH] Fix PERL_UNUSED_ARG() definition in XSUB.h --- ...ersions-of-PERL_UNUSED_foo-in-XSUB.h.patch | 43 +++++++++++++++++++ perl.spec | 6 +++ 2 files changed, 49 insertions(+) create mode 100644 perl-5.33.5-Use-perl.h-versions-of-PERL_UNUSED_foo-in-XSUB.h.patch diff --git a/perl-5.33.5-Use-perl.h-versions-of-PERL_UNUSED_foo-in-XSUB.h.patch b/perl-5.33.5-Use-perl.h-versions-of-PERL_UNUSED_foo-in-XSUB.h.patch new file mode 100644 index 0000000..31d7bf4 --- /dev/null +++ b/perl-5.33.5-Use-perl.h-versions-of-PERL_UNUSED_foo-in-XSUB.h.patch @@ -0,0 +1,43 @@ +From 036189b0a003875df7bf09c7f7fd702267f549e5 Mon Sep 17 00:00:00 2001 +From: Karl Williamson +Date: Sat, 26 Dec 2020 08:44:08 -0700 +Subject: [PATCH] Use perl.h versions of PERL_UNUSED_foo in XSUB.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This commit was applied to perl.h, but not to XSUB.h: + +commit a730e3f230f364cffe49370f816f975ae7c9c403 +Author: Jarkko Hietaniemi +Date: Thu Sep 4 09:08:33 2014 -0400 + +Use sizeof() in UNUSED_ARG and UNUSED_VAR to avoid accessing the values. + +The values might even be uninitialized in the case of PERL_UNUSED_VAR. + +Signed-off-by: Petr Písař +--- + XSUB.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/XSUB.h b/XSUB.h +index 616d813840..c1e3959885 100644 +--- a/XSUB.h ++++ b/XSUB.h +@@ -108,10 +108,10 @@ is a lexical C<$_> in scope. + */ + + #ifndef PERL_UNUSED_ARG +-# define PERL_UNUSED_ARG(x) ((void)x) ++# define PERL_UNUSED_ARG(x) ((void)sizeof(x)) + #endif + #ifndef PERL_UNUSED_VAR +-# define PERL_UNUSED_VAR(x) ((void)x) ++# define PERL_UNUSED_VAR(x) ((void)sizeof(x)) + #endif + + #define ST(off) PL_stack_base[ax + (off)] +-- +2.26.2 + diff --git a/perl.spec b/perl.spec index 35fc75a..a64d4b9 100644 --- a/perl.spec +++ b/perl.spec @@ -255,6 +255,9 @@ Patch50: perl-5.33.5-Fix-buggy-fc-in-Turkish-locale.patch # in upstream after 5.33.5 Patch51: perl-5.33.5-op.c-croak-on-my-_-when-use-utf8-is-in-effect.patch +# Fix PERL_UNUSED_ARG() definition in XSUB.h, in upstream after 5.33.5 +Patch52: perl-5.33.5-Use-perl.h-versions-of-PERL_UNUSED_foo-in-XSUB.h.patch + # Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048 Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch @@ -4307,6 +4310,7 @@ you're not running VMS, this module does nothing. %patch49 -p1 %patch50 -p1 %patch51 -p1 +%patch52 -p1 %patch200 -p1 %patch201 -p1 @@ -4357,6 +4361,7 @@ perl -x patchlevel.h \ 'Fedora Patch49: Use duplocale() if available' \ 'Fedora Patch50: Fix fc() in Turkish locale' \ 'Fedora Patch51: Fix croaking on "my $_" when "use utf8" is in effect (GH#18449)' \ + 'Fedora Patch52: Fix PERL_UNUSED_ARG() definition in XSUB.h' \ 'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \ 'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \ %{nil} @@ -7089,6 +7094,7 @@ popd - Use duplocale() if available - Fix fc() in Turkish locale - Fix croaking on "my $_" when "use utf8" is in effect (GH#18449) +- Fix PERL_UNUSED_ARG() definition in XSUB.h * Tue Jan 26 2021 Fedora Release Engineering - 4:5.32.1-470 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild