This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The 'nv' here is not always a NV, so have our own format.
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 3 Sep 2014 02:13:05 +0000 (22:13 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 3 Sep 2014 02:31:19 +0000 (22:31 -0400)
(The added printing of the NV in case of frexp() mess-up caused
 -Wformat warnings.)

(One could argue for renaming the variable to be less confusing.)

sv.c

diff --git a/sv.c b/sv.c
index 291406e..65aa456 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10988,8 +10988,10 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
        */
 #if defined(HAS_LONG_DOUBLE) && LONG_DOUBLESIZE > DOUBLESIZE
        long double nv;
+#  define myNVgf PERL_PRIgldbl
 #else
        NV nv;
+#  define myNVgf NVgf
 #endif
        STRLEN have;
        STRLEN need;
@@ -11724,7 +11726,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
                 i = PERL_INT_MIN;
                 (void)Perl_frexp(nv, &i);
                 if (i == PERL_INT_MIN)
-                    Perl_die(aTHX_ "panic: frexp: %"NVgf, nv);
+                    Perl_die(aTHX_ "panic: frexp: %"myNVgf, nv);
                 /* Do not set hexfp earlier since we want to printf
                  * Inf/NaN for Inf/NAN, not their hexfp. */
                 hexfp = isALPHA_FOLD_EQ(c, 'a');