Avoid compiler warnings due to mismatched types in *printf format strings.
authorRobin Barker <RMBarker@cpan.org>
Mon, 17 Dec 2012 17:20:14 +0000 (18:20 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 8 Aug 2017 13:18:29 +0000 (15:18 +0200)
gcc (and probably others) was warning about a mismatch for between `int`
(implied by the format %d) and the actual type passed, `line_t`. Avoid this
by explicitly casting to UV, and using UVuf.

CPAN #63832

cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm

index 545d322..c7e6d05 100644 (file)
@@ -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