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