8446b7
From 036189b0a003875df7bf09c7f7fd702267f549e5 Mon Sep 17 00:00:00 2001
8446b7
From: Karl Williamson <khw@cpan.org>
8446b7
Date: Sat, 26 Dec 2020 08:44:08 -0700
8446b7
Subject: [PATCH] Use perl.h versions of PERL_UNUSED_foo in XSUB.h
8446b7
MIME-Version: 1.0
8446b7
Content-Type: text/plain; charset=UTF-8
8446b7
Content-Transfer-Encoding: 8bit
8446b7
8446b7
This commit was applied to perl.h, but not to XSUB.h:
8446b7
8446b7
commit a730e3f230f364cffe49370f816f975ae7c9c403
8446b7
Author: Jarkko Hietaniemi <jhi@iki.fi>
8446b7
Date:   Thu Sep 4 09:08:33 2014 -0400
8446b7
8446b7
Use sizeof() in UNUSED_ARG and UNUSED_VAR to avoid accessing the values.
8446b7
8446b7
The values might even be uninitialized in the case of PERL_UNUSED_VAR.
8446b7
8446b7
Signed-off-by: Petr Písař <ppisar@redhat.com>
8446b7
---
8446b7
 XSUB.h | 4 ++--
8446b7
 1 file changed, 2 insertions(+), 2 deletions(-)
8446b7
8446b7
diff --git a/XSUB.h b/XSUB.h
8446b7
index 616d813840..c1e3959885 100644
8446b7
--- a/XSUB.h
8446b7
+++ b/XSUB.h
8446b7
@@ -108,10 +108,10 @@ is a lexical C<$_> in scope.
8446b7
 */
8446b7
 
8446b7
 #ifndef PERL_UNUSED_ARG
8446b7
-#  define PERL_UNUSED_ARG(x) ((void)x)
8446b7
+#  define PERL_UNUSED_ARG(x) ((void)sizeof(x))
8446b7
 #endif
8446b7
 #ifndef PERL_UNUSED_VAR
8446b7
-#  define PERL_UNUSED_VAR(x) ((void)x)
8446b7
+#  define PERL_UNUSED_VAR(x) ((void)sizeof(x))
8446b7
 #endif
8446b7
 
8446b7
 #define ST(off) PL_stack_base[ax + (off)]
8446b7
-- 
8446b7
2.26.2
8446b7