From ae82eec1ac99004a011fae8a5ae4ad25a16fffae Mon Sep 17 00:00:00 2001 From: darthgandalf Date: Mon, 24 Jan 2011 18:18:42 +0000 Subject: [PATCH] Fix warnings "variable 'ax' set but not used [-Wunused-but-set-variable]" of modperl. http://perldoc.perl.org/perlcall.html wants us to declare and set this variable, but it seems that not every perl actually uses it. So let me introduce you this small workaround which uses ax's value. Thanks to nb for reporting this. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2273 726aef4b-f618-498e-8847-2d620e286838 --- modules/modperl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/modperl.cpp b/modules/modperl.cpp index 7240bbbf..f2c2d2fd 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -39,7 +39,7 @@ public: #define PSTART dSP; I32 ax; int ret = 0; ENTER; SAVETMPS; PUSHMARK(SP) #define PCALL(name) PUTBACK; ret = call_pv(name, G_EVAL|G_ARRAY); SPAGAIN; SP -= ret; ax = (SP - PL_stack_base) + 1 -#define PEND PUTBACK; FREETMPS; LEAVE +#define PEND ax += 0; PUTBACK; FREETMPS; LEAVE #define PUSH_STR(s) XPUSHs(PString(s).GetSV()) #define PUSH_PTR(type, p) XPUSHs(SWIG_NewInstanceObj(const_cast(p), SWIG_TypeQuery(#type), SWIG_SHADOW))