Subject: | NV format mismatches |
Date: | Thu, 9 Jan 2014 16:33:11 +0000 |
To: | bug-Devel-NYTProf [...] rt.cpan.org |
From: | Zefram <zefram [...] fysh.org> |
Compile warnings:
cc -c -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -ggdb -O2 -DVERSION=\"5.06\" -DXS_VERSION=\"5.06\" -fPIC -O2 -pipe "-I/opt/perl-5.18.1/lib/5.18.1/x86_64-linux-ld/CORE" -DHAS_CLOCK_GETTIME -DHAS_ZLIB -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter FileHandle.c
FileHandle.xs: In function 'NYTP_write_attribute_nv':
FileHandle.xs:920:5: warning: format '%g' expects argument of type 'double', but argument 4 has type 'NV' [-Wformat]
FileHandle.xs:920:5: warning: format '%g' expects argument of type 'double', but argument 4 has type 'NV' [-Wformat]
GEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -ggdb -O2 -DVERSION=\"5.06\" -DXS_VERSION=\"5.06\" -fPIC -O2 -pipe "-I/opt/perl-5.18.1/lib/5.18.1/x86_64-linux-ld/CORE" -DHAS_CLOCK_GETTIME -DHAS_ZLIB -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter NYTProf.c
NYTProf.xs: In function 'open_output_file':
NYTProf.xs:1769:9: warning: format '%f' expects argument of type 'double', but argument 3 has type 'NV' [-Wformat]
NYTProf.xs: In function 'close_output_file':
NYTProf.xs:1799:9: warning: format '%f' expects argument of type 'double', but argument 2 has type 'NV' [-Wformat]
NYTProf.xs: In function 'finish_profile':
NYTProf.xs:2960:13: warning: format '%g' expects argument of type 'double', but argument 2 has type 'NV' [-Wformat]
NV is long double on this perl. The Perl core headers provide some macros
for format specifiers that should address this, but I think there's an
issue with them about portability to older Perl versions. Attached patch
uses the macros with no concern for Perl version portability.
-zefram
Message body is not shown because sender requested not to inline it.