From: Robin Barker Date: Thu, 9 May 2002 18:27:30 +0000 (+0100) Subject: format and other warnings X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=436c6dd385a3b29cadf4fa091af1c55eed665e29;p=p5sagit%2Fp5-mst-13.2.git format and other warnings Message-Id: <200205091727.SAA22792@tempest.npl.co.uk> p4raw-id: //depot/perl@16532 --- diff --git a/Porting/pumpkin.pod b/Porting/pumpkin.pod index fe4d9c8..141a60a 100644 --- a/Porting/pumpkin.pod +++ b/Porting/pumpkin.pod @@ -755,7 +755,7 @@ and build everything else from that with -DCHECK_FORMAT make clean make miniperl - make all OPTIMIZE=-DCHECK_FORMAT >& make.log + make all OPTIMIZE='-DCHECK_FORMAT -Wformat' >& make.log =item * diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs index 0f3f1d4..09918a1 100644 --- a/ext/Encode/Encode.xs +++ b/ext/Encode/Encode.xs @@ -80,7 +80,7 @@ encode_method(pTHX_ encode_t * enc, encpage_t * dir, SV * src, goto ENCODE_END; } - while (code = do_encode(dir, s, &slen, d, dlen, &dlen, !check)) + while( (code = do_encode(dir, s, &slen, d, dlen, &dlen, !check)) ) { SvCUR_set(dst, dlen+ddone); SvPOK_only(dst); @@ -172,14 +172,14 @@ encode_method(pTHX_ encode_t * enc, encpage_t * dir, SV * src, else { if (check & ENCODE_DIE_ON_ERR){ Perl_croak(aTHX_ ERR_DECODE_NOMAP, - PTR2UV(enc->name[0]), (U8)s[slen]); + enc->name[0], (UV)s[slen]); return &PL_sv_undef; /* never reaches but be safe */ } if (check & ENCODE_WARN_ON_ERR){ Perl_warner( aTHX_ packWARN(WARN_UTF8), ERR_DECODE_NOMAP, - PTR2UV(enc->name[0]), (U8)s[slen]); + enc->name[0], (UV)s[slen]); } if (check & ENCODE_RETURN_ON_ERR){ goto ENCODE_SET_SRC; diff --git a/ext/Encode/Unicode/Unicode.xs b/ext/Encode/Unicode/Unicode.xs index e3ad82c..a330ea0 100644 --- a/ext/Encode/Unicode/Unicode.xs +++ b/ext/Encode/Unicode/Unicode.xs @@ -212,7 +212,7 @@ CODE: if (!issurrogate(ord)){ if (ucs2) { if (check) { - croak("%s:code point \"\\x{"UVxf"}\" too high", + croak("%s:code point \"\\x{%"UVxf"}\" too high", SvPV_nolen( *hv_fetch((HV *)SvRV(obj),"Name",4,0)) ,ord); diff --git a/ext/Storable/Storable.xs b/ext/Storable/Storable.xs index 04e5c7e..8b7c0cc 100644 --- a/ext/Storable/Storable.xs +++ b/ext/Storable/Storable.xs @@ -378,7 +378,7 @@ typedef struct stcxt { #define dSTCXT_PTR(T,name) \ T name = ((perinterp_sv && SvIOK(perinterp_sv) && SvIVX(perinterp_sv) \ - ? (T)SvPVX(SvRV((SV*)SvIVX(perinterp_sv))) : (T) 0)) + ? (T)SvPVX(SvRV(INT2PTR(SV*,SvIVX(perinterp_sv)))) : (T) 0)) #define dSTCXT \ dSTCXT_SV; \ dSTCXT_PTR(stcxt_t *, cxt) diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs index 9d3586d..3db3902 100644 --- a/ext/Time/HiRes/HiRes.xs +++ b/ext/Time/HiRes/HiRes.xs @@ -746,7 +746,7 @@ setitimer(which, seconds, interval = 0) struct itimerval oldit; PPCODE: if (seconds < 0.0 || interval < 0.0) - croak("Time::HiRes::setitimer(%"IVdf", %"NVgf", %"NVgf"): negative time not invented yet", which, seconds, interval); + croak("Time::HiRes::setitimer(%"IVdf", %"NVgf", %"NVgf"): negative time not invented yet", (IV)which, seconds, interval); newit.it_value.tv_sec = seconds; newit.it_value.tv_usec = (seconds - (NV)newit.it_value.tv_sec) * 1000000.0; diff --git a/ext/threads/shared/shared.xs b/ext/threads/shared/shared.xs index 3442213..477cdb4 100644 --- a/ext/threads/shared/shared.xs +++ b/ext/threads/shared/shared.xs @@ -262,7 +262,7 @@ Perl_sharedsv_associate(pTHX_ SV **psv, SV *ssv, shared_sv *data) /* Try shared SV as 1st choice */ if (!data && ssv && SvTYPE(ssv) >= SVt_PVMG) { - if (mg = mg_find(ssv, PERL_MAGIC_ext)) { + if( (mg = mg_find(ssv, PERL_MAGIC_ext)) ){ data = (shared_sv *) mg->mg_ptr; } } @@ -916,7 +916,7 @@ CODE: shared_sv *shared; if(SvROK(ref)) ref = SvRV(ref); - if (shared = Perl_sharedsv_find(aTHX_ ref)) { + if( (shared = Perl_sharedsv_find(aTHX_ ref)) ){ ST(0) = sv_2mortal(newSViv(PTR2IV(shared))); XSRETURN(1); } @@ -930,17 +930,17 @@ CODE: shared_sv *shared; if(SvROK(ref)) ref = SvRV(ref); - if (shared = Perl_sharedsv_find(aTHX_ ref)) { + if( (shared = Perl_sharedsv_find(aTHX_ ref)) ){ if (SHAREDSvPTR(shared)) { ST(0) = sv_2mortal(newSViv(SvREFCNT(SHAREDSvPTR(shared)))); XSRETURN(1); } else { - Perl_warn(aTHX_ "%_ s=%p has no shared SV",ST(0),shared); + Perl_warn(aTHX_ "%" SVf " s=%p has no shared SV",ST(0),shared); } } else { - Perl_warn(aTHX_ "%_ is not shared",ST(0)); + Perl_warn(aTHX_ "%" SVf " is not shared",ST(0)); } XSRETURN_UNDEF; diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index 2ebbd83..1c2c133 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -143,7 +143,8 @@ Perl_ithread_hook(pTHX) int veto_cleanup = 0; MUTEX_LOCK(&create_destruct_mutex); if (aTHX == PL_curinterp && active_threads != 1) { - Perl_warn(aTHX_ "Cleanup skipped %d active threads", active_threads); + Perl_warn(aTHX_ "Cleanup skipped %" IVdf " active threads", + (IV)active_threads); veto_cleanup = 1; } MUTEX_UNLOCK(&create_destruct_mutex); @@ -279,7 +280,7 @@ Perl_ithread_run(void * arg) { } PUTBACK; if (SvTRUE(ERRSV)) { - Perl_warn(aTHX_ "Died:%_",ERRSV); + Perl_warn(aTHX_ "Died:%" SVf,ERRSV); } FREETMPS; LEAVE; @@ -467,7 +468,7 @@ Perl_ithread_CLONE(pTHX_ SV *obj) } else { - Perl_warn(aTHX_ "CLONE %_",obj); + Perl_warn(aTHX_ "CLONE %" SVf,obj); } }