summaryrefslogtreecommitdiff
path: root/XSUB.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-12-26 08:44:08 -0700
committerKarl Williamson <khw@cpan.org>2021-01-03 08:36:01 -0700
commit036189b0a003875df7bf09c7f7fd702267f549e5 (patch)
tree9467ef077d96b24ee92c3458e30a282b7dbaec3f /XSUB.h
parent46033c991aa390e9da2bdb8c8005b6806d7bffdc (diff)
downloadperl-036189b0a003875df7bf09c7f7fd702267f549e5.tar.gz
Use perl.h versions of PERL_UNUSED_foo in XSUB.h
This commit was applied to perl.h, but not to XSUB.h: commit a730e3f230f364cffe49370f816f975ae7c9c403 Author: Jarkko Hietaniemi <jhi@iki.fi> 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.
Diffstat (limited to 'XSUB.h')
-rw-r--r--XSUB.h4
1 files 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)]