From e1d502de99d9d1c630ae07b71281c2f975bfbc50 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 3 Dec 2024 14:37:22 +1100 Subject: [PATCH] sv_inline.h:Perl_new_sv: prevent unused parameter warnings This would warn if you built with -DDEBUG_LEAKING_SCALARS and without -DDEBUGGING and without -DPERL_MEM_LOG, since these enable the code that actually uses the parameters. sv_inline.h: In function 'Perl_new_sv': sv_inline.h:72:31: warning: unused parameter 'file' [-Wunused-parameter] 72 | Perl_new_sv(pTHX_ const char *file, int line, const char *func) | ~~~~~~~~~~~~^~~~ sv_inline.h:72:41: warning: unused parameter 'line' [-Wunused-parameter] 72 | Perl_new_sv(pTHX_ const char *file, int line, const char *func) | ~~~~^~~~ sv_inline.h:72:59: warning: unused parameter 'func' [-Wunused-parameter] 72 | Perl_new_sv(pTHX_ const char *file, int line, const char *func) | ~~~~~~~~~~~~^~~~ Fixes #22806 --- sv_inline.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sv_inline.h b/sv_inline.h index 7cbca95feef7..57a68796cb02 100644 --- a/sv_inline.h +++ b/sv_inline.h @@ -72,7 +72,8 @@ PERL_STATIC_INLINE SV* Perl_new_sv(pTHX_ const char *file, int line, const char *func) { SV* sv; -#ifndef DEBUG_LEAKING_SCALARS +#if !defined(DEBUG_LEAKING_SCALARS) || \ + (!defined(DEBUGGING) && !defined(PERL_MEM_LOG)) PERL_UNUSED_ARG(file); PERL_UNUSED_ARG(line); PERL_UNUSED_ARG(func);