You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2015/09/11 10:28:55 UTC

svn commit: r1702395 - /perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h

Author: stevehay
Date: Fri Sep 11 08:28:54 2015
New Revision: 1702395

URL: http://svn.apache.org/r1702395
Log:
Fix t/modperl/print.t, t/modperl/printf.t and t/directive/perlloadmodule3.t under perl-5.22.0

I'm working on CPAN RT#101962: Support for perl-5.22.0. The new "Redundant argument in subroutine entry" warning for printf-type functions has revealed a problem in our printf override which causes these tests to fail. In threaded builds we wrongly included the thread context in the count of arguments being passed to perl's sprintf implementation, which then warned that more arguments were being passed than the format string required. With warnings being fatalized in all test scripts this caused a few test scripts to fail.

Modified:
    perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h

Modified: perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h?rev=1702395&r1=1702394&r2=1702395&view=diff
==============================================================================
--- perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h (original)
+++ perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h Fri Sep 11 08:28:54 2015
@@ -111,6 +111,14 @@ apr_size_t mpxs_ap_rprintf(pTHX_ I32 ite
 
     rcfg = modperl_config_req_get(r);
 
+    /* Reduce items by 1 for threaded builds since it otherwise includes
+     * the thread context, which shouldn't be included in the count of
+     * arguments being given to the sprintf() call.
+     */
+#ifdef USE_ITHREADS
+    --items;
+#endif
+
     /* XXX: we could have an rcfg->sprintf_buffer to reuse this SV
      * across requests
      */