summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--XSUB.h22
-rw-r--r--perl.h9
-rw-r--r--universal.c7
3 files changed, 35 insertions, 3 deletions
diff --git a/XSUB.h b/XSUB.h
index 52f66a600a..bec91a8434 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -82,6 +82,15 @@ is a lexical $_ in scope.
=cut
*/
+#ifndef LINT_UNUSED_ARG
+# ifdef lint
+# include <note.h>
+# define LINT_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
+# else
+# define LINT_UNUSED_ARG(x)
+# endif
+#endif
+
#define ST(off) PL_stack_base[ax + (off)]
#undef XS
@@ -107,7 +116,8 @@ is a lexical $_ in scope.
#define dITEMS I32 items = SP - MARK
-#define dXSARGS \
+#define dXSARGS \
+ LINT_UNUSED_ARG(cv) \
dSP; dAXMARK; dITEMS
#define dXSTARG SV * const targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
@@ -601,3 +611,13 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
#endif /* PERL_IMPLICIT_SYS && !PERL_CORE */
#endif /* _INC_PERL_XSUB_H */ /* include guard */
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */
diff --git a/perl.h b/perl.h
index 5eff7de71f..c85543dd50 100644
--- a/perl.h
+++ b/perl.h
@@ -212,6 +212,15 @@
*/
#define PERL_UNUSED_VAR(var) ((void)var)
+#ifndef LINT_UNUSED_ARG
+# ifdef lint
+# include <note.h>
+# define LINT_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
+# else
+# define LINT_UNUSED_ARG(x)
+# endif
+#endif
+
#define NOOP (void)0
#define dNOOP extern int Perl___notused PERL_UNUSED_DECL
diff --git a/universal.c b/universal.c
index 1564b59eaa..99a3dd9eb1 100644
--- a/universal.c
+++ b/universal.c
@@ -819,6 +819,7 @@ XS(XS_Internals_hv_clear_placehold)
XS(XS_Regexp_DESTROY)
{
+ LINT_UNUSED_ARG(cv)
}
XS(XS_PerlIO_get_layers)
@@ -951,7 +952,8 @@ XS(XS_Internals_hash_seed)
/* Using dXSARGS would also have dITEM and dSP,
* which define 2 unused local variables. */
dAXMARK;
- (void)mark;
+ LINT_UNUSED_ARG(cv)
+ PERL_UNUSED_VAR(mark);
XSRETURN_UV(PERL_HASH_SEED);
}
@@ -960,7 +962,8 @@ XS(XS_Internals_rehash_seed)
/* Using dXSARGS would also have dITEM and dSP,
* which define 2 unused local variables. */
dAXMARK;
- (void)mark;
+ LINT_UNUSED_ARG(cv)
+ PERL_UNUSED_VAR(mark);
XSRETURN_UV(PL_rehash_seed);
}