Control: forwarded -1 https://rt.cpan.org/Public/Bug/Display.html?id=158609
Control: tags -1 + patch

Greetings,

Fedora maintainers have identified and reported the same issue a
couple of weeks ago.  There were a couple of discussions about
the shape to give to the patch: remove the argument passed to
nvtime vs adjust every function missing argument.  I lean to
the latter option.  Hereafter is the patch from RT CPAN:

-------8<--------------8<--------------8<--------------8<-------
--- Coro/State.xs
+++ Coro/State.xs
@@ -156,7 +156,7 @@ static void *coro_thx;
 # include <assert.h>
 #endif
 
-static double (*nvtime)(); /* so why doesn't it take void? */
+static double (*nvtime)(pTHX); /* so why doesn't it take void? */
 static void   (*u2time)(pTHX_ UV ret[2]);
 
 /* we hijack an hopefully unused CV flag for our purposes */
@@ -391,7 +391,7 @@ coro_u2time (pTHX_ UV ret[2])
 }
 
 ecb_inline double
-coro_nvtime (void)
+coro_nvtime (pTHX)
 {
   struct timeval tv;
   gettimeofday (&tv, 0);
@@ -420,7 +420,7 @@ time_init (pTHX)
   if (!svp)          croak ("Time::HiRes is required, but missing. Caught");
   if (!SvIOK (*svp)) croak ("Time::NVtime isn't a function pointer. Caught");
 
-  nvtime = INT2PTR (double (*)(), SvIV (*svp));
+  nvtime = INT2PTR (double (*)(pTHX), SvIV (*svp));
 
   svp = hv_fetch (PL_modglobal, "Time::U2time", 12, 0);
   u2time = INT2PTR (void (*)(pTHX_ UV ret[2]), SvIV (*svp));
@@ -3031,7 +3031,7 @@ PerlIOCede_pushed (pTHX_ PerlIO *f, cons
   PerlIOCede *self = PerlIOSelf (f, PerlIOCede);
 
   self->every = SvCUR (arg) ? SvNV (arg) : 0.01;
-  self->next  = nvtime () + self->every;
+  self->next  = nvtime (aTHX) + self->every;
 
   return PerlIOBuf_pushed (aTHX_ f, mode, Nullsv, tab);
 }
@@ -3048,7 +3048,7 @@ static IV
 PerlIOCede_flush (pTHX_ PerlIO *f)
 {
   PerlIOCede *self = PerlIOSelf (f, PerlIOCede);
-  double now = nvtime ();
+  double now = nvtime (aTHX);
 
   if (now >= self->next)
     {
-------8<--------------8<--------------8<--------------8<-------

I have difficulties to credit the patch, hope "github [...]
trace.city-fan.org" will suffice.

Have a nice day,  :)
-- 
  .''`.  Étienne Mollier <emoll...@debian.org>
 : :' :  pgp: 8f91 b227 c7d6 f2b1 948c  8236 793c f67e 8f0d 11da
 `. `'   sent from /dev/pts/4, please excuse my verbosity
   `-    on air: Supertramp - School

Attachment: signature.asc
Description: PGP signature

Reply via email to