Skip to content

Commit e1e4896

Browse files
committed
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
1 parent 9c2eed8 commit e1e4896

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sv_inline.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ PERL_STATIC_INLINE SV*
7272
Perl_new_sv(pTHX_ const char *file, int line, const char *func)
7373
{
7474
SV* sv;
75-
#ifndef DEBUG_LEAKING_SCALARS
75+
#if !defined(DEBUG_LEAKING_SCALARS) || \
76+
(!defined(DEBUGGING) && !defined(PERL_MEM_LOG))
7677
PERL_UNUSED_ARG(file);
7778
PERL_UNUSED_ARG(line);
7879
PERL_UNUSED_ARG(func);

0 commit comments

Comments
 (0)