Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Time-HiRes CPAN distribution.

Report information
The Basics
Id:
102718
Status:
resolved
Priority:
Low/Low
Queue:

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

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Subject: clock_t is unsigned in OS X
Compilation noise from 1.9726 in OS X, with bleadperl: HiRes.xs:1250:18: warning: comparison of integers of different signs: 'clock_t' (aka 'unsigned long') and 'int' [-Wsign-compare] RETVAL = clocks == -1 ? -1 : (NV)clocks / (NV)CLOCKS_PER_SEC; ~~~~~~ ^ This is because clock_t is unsigned in OS X. Casting the -1 (both of them) to (clocks_t) makes the warning go away.
On 2015-03-12 04:33:39, JHI wrote:
Show quoted text
> Compilation noise from 1.9726 in OS X, with bleadperl: > > HiRes.xs:1250:18: warning: comparison of integers of different signs: > 'clock_t' (aka 'unsigned long') and 'int' > [-Wsign-compare] > RETVAL = clocks == -1 ? -1 : (NV)clocks / (NV)CLOCKS_PER_SEC; > ~~~~~~ ^ > > This is because clock_t is unsigned in OS X. Casting the -1 (both of > them) to (clocks_t) makes the warning go away.
I don't see this under 5.21.10 (OSX 10.10.2): Checking dependencies from MYMETA.json ... Checking if you have Test::More 0.82 ... Yes (1.001014) Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.05_19) Checking if you have Config 0 ... Yes (5.021010) Checking if you have Exporter 0 ... Yes (5.72) Checking if you have strict 0 ... Yes (1.09) Checking if you have DynaLoader 0 ... Yes (1.32) Checking if you have Carp 0 ... Yes (1.36) Building and testing Time-HiRes-1.9726 ... Running Mkbootstrap for HiRes () chmod 644 "HiRes.bs" "/Volumes/amaretto/Users/ether/perl5/perlbrew/perls/21.10/bin/perl5.21.10" -MExtUtils::Command::MM -e 'cp_nonempty' -- HiRes.bs blib/arch/auto/Time/HiRes/HiRes.bs 644 "/Volumes/amaretto/Users/ether/perl5/perlbrew/perls/21.10/bin/perl5.21.10" "/Volumes/amaretto/Users/ether/perl5/perlbrew/perls/21.10/lib/5.21.10/ExtUtils/xsubpp" -typemap '/Volumes/amaretto/Users/ether/perl5/perlbrew/perls/21.10/lib/5.21.10/ExtUtils/typemap' -typemap '/Volumes/amaretto/Users/ether/.cpanm/work/1427488302.31648/Time-HiRes-1.9726/typemap' HiRes.xs > HiRes.xsc mv HiRes.xsc HiRes.c cc -c -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/opt/local/include -O3 -DVERSION=\"1.9726\" -DXS_VERSION=\"1.9726\" "-I/Volumes/amaretto/Users/ether/perl5/perlbrew/perls/21.10/lib/5.21.10/darwin-2level/CORE" -DTIME_HIRES_NANOSLEEP -DTIME_HIRES_CLOCK -DTIME_HIRES_STAT=1 -DATLEASTFIVEOHOHFIVE HiRes.c -o HiRes.o rm -f blib/arch/auto/Time/HiRes/HiRes.bundle env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/opt/local/lib -fstack-protector -o blib/arch/auto/Time/HiRes/HiRes.bundle HiRes.o \ \ chmod 755 blib/arch/auto/Time/HiRes/HiRes.bundle
Show quoted text
> I don't see this under 5.21.10 (OSX 10.10.2): > ... > cc -c -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack- > protector -I/opt/local/include -O3 -DVERSION=\"1.9726\" > -DXS_VERSION=\"1.9726\" "- > I/Volumes/amaretto/Users/ether/perl5/perlbrew/perls/21.10/lib/5.21.10/darwin- > 2level/CORE" -DTIME_HIRES_NANOSLEEP -DTIME_HIRES_CLOCK > -DTIME_HIRES_STAT=1 -DATLEASTFIVEOHOHFIVE HiRes.c -o HiRes.o > rm -f blib/arch/auto/Time/HiRes/HiRes.bundle > env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined
10.10.2 also here, but clang 3.6: clang-mp-3.6 -c -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -I/opt/local/include -Wall -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings -O3 -DVERSION=\"1.9726\" -DXS_VERSION=\"1.9726\" "-I../.." -DTIME_HIRES_NANOSLEEP -DTIME_HIRES_CLOCK -DTIME_HIRES_STAT=1 -DATLEASTFIVEOHOHFIVE HiRes.c HiRes.xs:1250:18: warning: comparison of integers of different signs: 'clock_t' (aka 'unsigned long') and 'int' [-Wsign-compare] RETVAL = clocks == -1 ? -1 : (NV)clocks / (NV)CLOCKS_PER_SEC; ~~~~~~ ^ ~~ While "cc -v" says: cc -v Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.1.0 Thread model: posix
Still seeing the issue with clang 3.7. Patch attached.
Subject: HiRes.xs.pat

Message body not shown because it is not plain text.

Thanks, this has been applied and will be in a dev release today or tomorrow. -- rjbs


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.