Skip Menu |

This queue is for tickets about the ExtUtils-Constant CPAN distribution.

Report information
The Basics
Id: 63832
Status: patched
Priority: 0/
Queue: ExtUtils-Constant

People
Owner: Nobody in particular
Requestors: davem [...] iabyn.com
JHI [...] cpan.org
zefram [...] fysh.org
Cc:
AdminCc:

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



Subject: printf warnings from EU:C
Date: Sat, 11 Dec 2010 17:17:22 +0000
To: bug-ExtUtils-Constant [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
Many modules that use ExtUtils::Constant get compiler warnings such as these: cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"1.12\" -DXS_VERSION=\"1.12\" -fPIC "-I../.." GDBM_File.c ./const-xs.inc: In function 'XS_GDBM_File_AUTOLOAD': ./const-xs.inc:137: warning: format '%d' expects type 'int', but argument 4 has type 'line_t' ./const-xs.inc:142: warning: format '%d' expects type 'int', but argument 4 has type 'line_t' The arguments being complained of are CopLINE(cop) in the autogenerated AUTOLOAD xsub. The ultimate source is in ExtUtils::Constant::ProxySubs::WriteConstants(). The solution is to explicitly cast these arguments to int. -zefram
Patch against perl-git source
Subject: proxysubs.patch
diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm index 545d322..c7e6d05 100644 --- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm +++ b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm @@ -629,13 +629,14 @@ EOA if ((C_ARRAY_LENGTH(values_for_notfound) > 1) ? hv_exists_ent(${c_subname}_missing, sv, 0) : 0) { sv = newSVpvf("Your vendor has not defined $package_sprintf_safe macro %" SVf - ", used at %" COP_FILE_F " line %d\\n", sv, - COP_FILE(cop), CopLINE(cop)); + ", used at %" COP_FILE_F " line %" UVuf "\\n", + sv, COP_FILE(cop), (UV)CopLINE(cop)); } else #endif { sv = newSVpvf("%"SVf" is not a valid $package_sprintf_safe macro at %" - COP_FILE_F " line %d\\n", sv, COP_FILE(cop), CopLINE(cop)); + COP_FILE_F " line %" UVuf "\\n", + sv, COP_FILE(cop), (UV)CopLINE(cop)); } croak_sv(sv_2mortal(sv)); EOC
Subject: line_t is not %d
Trying to compile core extensions with -Wall -Wextra.
Subject: 0001-printf-type-matching-line_t-some-platforms-is-not-d.patch
From cac416c776e5e24e754e983cc04f1ea5d1adfb0f Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi <jhi@iki.fi> Date: Thu, 4 Dec 2014 21:46:26 -0500 Subject: [PATCH] printf type-matching: line_t (some platforms) is not %d. --- cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm index 545d322..7da8d1a 100644 --- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm +++ b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm @@ -635,7 +635,7 @@ EOA #endif { sv = newSVpvf("%"SVf" is not a valid $package_sprintf_safe macro at %" - COP_FILE_F " line %d\\n", sv, COP_FILE(cop), CopLINE(cop)); + COP_FILE_F " line %d\\n", sv, COP_FILE(cop), (int)CopLINE(cop)); } croak_sv(sv_2mortal(sv)); EOC -- 2.1.2
On Fri Dec 05 21:18:34 2014, JHI wrote: Show quoted text
> Trying to compile core extensions with -Wall -Wextra.
RT #63832 contains a better patch by Zefram, using UV, not int. -- Reini Urban
On Sun Aug 30 08:36:52 2015, RURBAN wrote: Show quoted text
> On Fri Dec 05 21:18:34 2014, JHI wrote:
> > Trying to compile core extensions with -Wall -Wextra.
> > RT #63832 contains a better patch by Zefram, using UV, not int.
Excellent.
Subject: [PATCH] avoid a compiler warning
See attached patch for details
Subject: 0001-ProxySubs.pm-silence-compiler-warning.patch
From f9743b6d19189d6bdf34b4ec9a6e2bcedcdc5e2f Mon Sep 17 00:00:00 2001 From: David Mitchell <davem@iabyn.com> Date: Fri, 4 Mar 2016 11:14:09 +0000 Subject: [PATCH 1/2] ProxySubs.pm: silence compiler warning: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code it generated triggered compiler warnings like these: ./const-xs.inc:950:20: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘line_t {aka const long unsigned int}’ [-Wformat=] sv = newSVpvf("%"SVf" is not a valid Socket macro at %" cast long_t to UV before printf'ing it. --- cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm index 545d322..29b743d 100644 --- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm +++ b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm @@ -629,13 +629,14 @@ EOA if ((C_ARRAY_LENGTH(values_for_notfound) > 1) ? hv_exists_ent(${c_subname}_missing, sv, 0) : 0) { sv = newSVpvf("Your vendor has not defined $package_sprintf_safe macro %" SVf - ", used at %" COP_FILE_F " line %d\\n", sv, - COP_FILE(cop), CopLINE(cop)); + ", used at %" COP_FILE_F " line %"UVuf"\\n", sv, + COP_FILE(cop), (UV)CopLINE(cop)); } else #endif { sv = newSVpvf("%"SVf" is not a valid $package_sprintf_safe macro at %" - COP_FILE_F " line %d\\n", sv, COP_FILE(cop), CopLINE(cop)); + COP_FILE_F " line %"UVuf"\\n", sv, COP_FILE(cop), + (UV)CopLINE(cop)); } croak_sv(sv_2mortal(sv)); EOC -- 2.4.3
On Mon Dec 17 18:20:14 2012, RMBARKER wrote: Show quoted text
> Patch against perl-git source
Very late, but now applied and uploaded to CPAN as part of the dev release 0.23_50. Nicholas Clark