Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the devel-nytprof CPAN distribution.

Report information
The Basics
Id: 86728
Status: resolved
Priority: 0/
Queue: devel-nytprof

People
Owner: Nobody in particular
Requestors: alexander.bluhm [...] gmx.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 5.05
Fixed in: (no value)



Subject: Compiler warning format error
In OpenBSD amd64 I get this comiler warning. NYTProf.xs: In function '_init_profiler_clock': NYTProf.xs:3015: warning: format '%d' expects type 'int', but argument 2 has typ e 'IV' IV is typedef long on this platform, so %ld is needed for profile_clock. A few lines below it is correct.
Subject: patch-NYTProf_xs
Download patch-NYTProf_xs
application/octet-stream 647b

Message body not shown because it is not plain text.

From: alexander.bluhm [...] gmx.net
In OpenBSD i386 I get different warnings: NYTProf.xs: In function 'subr_entry_destroy': NYTProf.xs:1977: warning: format '%2d' expects type 'int', but argument 2 has type 'U32' NYTProf.xs: In function 'incr_sub_inclusive_time': NYTProf.xs:2148: warning: format '%2d' expects type 'int', but argument 2 has type 'U32' NYTProf.xs: In function 'subr_entry_setup': NYTProf.xs:2520: warning: format '%2d' expects type 'int', but argument 2 has type 'U32' NYTProf.xs: In function 'pp_subcall_profiler': NYTProf.xs:2696: warning: format '%2d' expects type 'int', but argument 2 has type 'U32' NYTProf.xs:2817: warning: format '%2d' expects type 'int', but argument 2 has type 'U32' Attached a patch, to fix both of them.
Subject: patch-NYTProf_xs
Download patch-NYTProf_xs
application/octet-stream 3.6k

Message body not shown because it is not plain text.

From: alexander.bluhm [...] gmx.net
It does not make sense to cast a U32 to (unsigned long), use (unsigned int) instead. That is the version of the patch I have comitted to the OpenBSD port. --- NYTProf.xs.orig Tue Jul 2 23:30:42 2013 +++ NYTProf.xs Thu Jul 18 14:28:27 2013 @@ -1968,8 +1968,8 @@ subr_entry_destroy(pTHX_ subr_entry_t *subr_entry) /* ignore the typical second (fallback) destroy */ && !(subr_entry->prev_subr_entry_ix == subr_entry_ix && subr_entry->already_counted==1) ) { - logwarn("%2d << %s::%s done %s\n", - subr_entry->subr_prof_depth, + logwarn("%2u << %s::%s done %s\n", + (unsigned int)subr_entry->subr_prof_depth, subr_entry->called_subpkg_pv, (subr_entry->called_subnam_sv && SvOK(subr_entry->called_subnam_sv)) ? SvPV_nolen(subr_entry->called_subnam_sv) @@ -2137,8 +2137,8 @@ incr_sub_inclusive_time(pTHX_ subr_entry_t *subr_entry } if (trace_level >= 5) { - logwarn("%2d <- %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n", - subr_entry->subr_prof_depth, called_subname_pv, + logwarn("%2u <- %s %"NVgf" excl = %"NVgf"t incl - %"NVgf"t (%"NVgf"-%"NVgf"), oh %"NVff"-%"NVff"=%"NVff"t, d%d @%d:%d #%lu %p\n", + (unsigned int)subr_entry->subr_prof_depth, called_subname_pv, excl_subr_ticks, incl_subr_ticks, called_sub_ticks, cumulative_subr_ticks, subr_entry->initial_subr_ticks, @@ -2509,8 +2509,8 @@ subr_entry_setup(pTHX_ COP *prev_cop, subr_entry_t *cl } if (trace_level >= 4) { - logwarn("%2d >> %s at %u:%d from %s::%s %s %s\n", - subr_entry->subr_prof_depth, + logwarn("%2u >> %s at %u:%d from %s::%s %s %s\n", + (unsigned int)subr_entry->subr_prof_depth, PL_op_name[op_type], subr_entry->caller_fid, subr_entry->caller_line, subr_entry->caller_subpkg_pv, @@ -2687,8 +2687,8 @@ pp_subcall_profiler(pTHX_ int is_slowop) */ if (subr_entry->already_counted) { if (trace_level >= 9) - logwarn("%2d -- %s::%s already counted %s\n", - subr_entry->subr_prof_depth, + logwarn("%2u -- %s::%s already counted %s\n", + (unsigned int)subr_entry->subr_prof_depth, subr_entry->called_subpkg_pv, (subr_entry->called_subnam_sv && SvOK(subr_entry->called_subnam_sv)) ? SvPV_nolen(subr_entry->called_subnam_sv) @@ -2802,8 +2802,8 @@ pp_subcall_profiler(pTHX_ int is_slowop) subr_entry->already_counted++; if (trace_level >= 4) { - logwarn("%2d ->%4s %s::%s from %s::%s @%u:%u (d%d, oh %"NVff"t, sub %"NVff"s) #%lu\n", - subr_entry->subr_prof_depth, + logwarn("%2u ->%4s %s::%s from %s::%s @%u:%u (d%d, oh %"NVff"t, sub %"NVff"s) #%lu\n", + (unsigned int)subr_entry->subr_prof_depth, (subr_entry->called_is_xs) ? subr_entry->called_is_xs : "sub", subr_entry->called_subpkg_pv, subr_entry->called_subnam_sv ? SvPV_nolen(subr_entry->called_subnam_sv) : "(null)", @@ -3011,7 +3011,7 @@ _init_profiler_clock(pTHX) /* downgrade to CLOCK_REALTIME if desired clock not available */ if (clock_gettime(profile_clock, &start_time) != 0) { if (trace_level) - logwarn("~ clock_gettime clock %d not available (%s) using CLOCK_REALTIME instead\n", + logwarn("~ clock_gettime clock %ld not available (%s) using CLOCK_REALTIME instead\n", profile_clock, strerror(errno)); profile_clock = CLOCK_REALTIME; /* check CLOCK_REALTIME as well, just in case */
Subject: patch-NYTProf_xs
Download patch-NYTProf_xs
application/octet-stream 3.6k

Message body not shown because it is not plain text.

Fixed in 4e31b29. Thanks!