From: Nicholas Clark Date: Sat, 29 Nov 2003 15:41:19 +0000 (+0000) Subject: When Gconvert is a macro around sprintf with a .* format we need X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2e59c212d7fc05bbdc88de96b76e8edb7b6a2b1d;p=p5sagit%2Fp5-mst-13.2.git When Gconvert is a macro around sprintf with a .* format we need to cast to int (in case STRLEN isn't the same size as int) gcc issues a warning even when it is the same size p4raw-id: //depot/perl@21806 --- diff --git a/sv.c b/sv.c index 3a05916..469faa9 100644 --- a/sv.c +++ b/sv.c @@ -8651,7 +8651,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV return; if (*pp == 'g') { if (digits < sizeof(ebuf) - NV_DIG - 10) { /* 0, point, slack */ - Gconvert(nv, digits, 0, ebuf); + Gconvert(nv, (int)digits, 0, ebuf); sv_catpv(sv, ebuf); if (*ebuf) /* May return an empty string for digits==0 */ return; @@ -9361,7 +9361,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV if ( !(width || left || plus || alt) && fill != '0' && has_precis && intsize != 'q' ) { /* Shortcuts */ if ( c == 'g') { - Gconvert((NV)nv, precis, 0, PL_efloatbuf); + Gconvert((NV)nv, (int)precis, 0, PL_efloatbuf); if (*PL_efloatbuf) /* May return an empty string for digits==0 */ goto float_converted; } else if ( c == 'f' && !precis) {