Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Devel-Cover CPAN distribution.

Report information
The Basics
Id: 20834
Status: resolved
Priority: 0/
Queue: Devel-Cover

People
Owner: Nobody in particular
Requestors: SMPETERS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.56
Fixed in: (no value)



Subject: Quieting warnings on FC5
The following diff quiets warnings seen when compiling on Fedora Core 5. --- Cover.xs.old 2006-08-03 09:19:26.000000000 -0500 +++ Cover.xs 2006-08-03 09:43:21.000000000 -0500 @@ -160,6 +160,7 @@ # endif #endif +#ifndef HAS_GETTIMEOFDAY static int cpu() { #ifdef WIN32 @@ -182,7 +183,7 @@ return e / HZ; } - +#endif /* HAS_GETTIMEOFDAY */ #endif /* HAS_TIMES */ static char *get_key(OP *o) @@ -387,7 +388,6 @@ static OP *get_condition(pTHX) { - dMY_CXT; SV **pc = hv_fetch(Pending_conditionals, get_key(PL_op), CH_SZ, 0); @@ -419,13 +419,12 @@ * to collect that lost information. */ - dMY_CXT; HE *e; MUTEX_LOCK(&DC_mutex); hv_iterinit(Pending_conditionals); - while (e = hv_iternext(Pending_conditionals)) + while ((e = hv_iternext(Pending_conditionals))) { NDEB(D(L, "finalise_conditions\n")); add_condition(aTHX_ hv_iterval(Pending_conditionals, e), 0); @@ -494,13 +493,13 @@ #endif NDEB(D(L, "cover_logop [%s]\n", get_key(PL_op))); - if (PL_op->op_type == OP_AND && left_val || - PL_op->op_type == OP_ANDASSIGN && left_val || - PL_op->op_type == OP_OR && !left_val || - PL_op->op_type == OP_ORASSIGN && !left_val || + if ((PL_op->op_type == OP_AND && left_val) || + (PL_op->op_type == OP_ANDASSIGN && left_val) || + (PL_op->op_type == OP_OR && !left_val) || + (PL_op->op_type == OP_ORASSIGN && !left_val) || #ifdef KEY_err - PL_op->op_type == OP_DOR && !left_val_def || - PL_op->op_type == OP_DORASSIGN && !left_val_def || + (PL_op->op_type == OP_DOR && !left_val_def) || + (PL_op->op_type == OP_DORASSIGN && !left_val_def) || #endif PL_op->op_type == OP_XOR) { @@ -917,7 +916,6 @@ { IV iv; char *type; - dMY_CXT; iv = PTR2IV(sv); type = svclassnames[SvTYPE(sv)]; @@ -1042,12 +1040,12 @@ OUTPUT: RETVAL -SV * +void coverage(final) unsigned final PREINIT: dMY_CXT; - CODE: + PPCODE: NDEB(D(L, "Getting coverage %d\n", final)); if (final) finalise_conditions(aTHX); ST(0) = sv_newmortal();
From: SMPETERS [...] cpan.org
The previous patch was bad. The following is much better in that it doesn't coredump when running the tests :) It changes the following... * Defines cpu() only if the libc has times() and not gettimeofday(). * Fixes some defines so cpu() will not be called in a case where the user does not have times() in their libc. * Fixes declaration on a variable in get_key(), so we eliminate a signed/unsigned comparison. --- Devel-Cover-0.59/Cover.xs 2006-08-23 01:45:51.000000000 -0500 +++ Devel-Cover-Patch/Cover.xs 2006-08-24 13:06:40.000000000 -0500 @@ -160,6 +160,7 @@ # endif #endif +#if !defined(HAS_GETTIMEOFDAY) static int cpu() { #ifdef WIN32 @@ -182,13 +183,14 @@ return e / HZ; } +#endif /* !defined(HAS_GETTIMEOFDAY) */ #endif /* HAS_TIMES */ static char *get_key(OP *o) { static union sequence uniq; - int i; + unsigned int i; dTHX; @@ -620,7 +622,7 @@ c = (SvTRUE(*count) ? SvNV(*count) : 0) + #if defined HAS_GETTIMEOFDAY elapsed(); -#else +#elif defined HAS_TIMES cpu(); #endif sv_setnv(*count, c);
Subject: Re: [rt.cpan.org #20834] Quieting warnings on FC5
Date: Sat, 30 Dec 2006 01:39:15 +0100
To: via RT <bug-Devel-Cover [...] rt.cpan.org>
From: Paul Johnson <paul [...] pjcj.net>
On Thu, Aug 24, 2006 at 02:14:14PM -0400, via RT wrote: Show quoted text
> The previous patch was bad. The following is much better in that it > doesn't coredump when running the tests :) It changes the following...
That's always good :-) Show quoted text
> * Defines cpu() only if the libc has times() and not gettimeofday().
Is there a reason not to define cpu() if both times() and gettimeofday() are available? At one point I had this crazy idea about allowing the user to select either elapsed or cpu time. Show quoted text
> * Fixes some defines so cpu() will not be called in a case where the > user does not have times() in their libc.
I think this was already covered by the CAN_PROFILE guard. Show quoted text
> * Fixes declaration on a variable in get_key(), so we eliminate a > signed/unsigned comparison.
Fortunately, Gisle has rewritten this function in a vastly improved manner, so this part is now obsolete. So I'll mark this as closed, but feel free to open it again if I have missed something. -- Paul Johnson - paul@pjcj.net http://www.pjcj.net