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