diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-07-06 12:50:59 -0300 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:12 -0700 |
commit | 34ee677231a207d2afb47d1272739b5e676d29e5 (patch) | |
tree | 0650f6c74889732d06182c2bb6429c6eca15a1cb /op.c | |
parent | ecad31f01819999d0e5aa744beb37e69192d8b71 (diff) | |
download | perl-34ee677231a207d2afb47d1272739b5e676d29e5.tar.gz |
Make op.c warnings UTF8-clean
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -987,6 +987,7 @@ Perl_scalarvoid(pTHX_ OP *o) dVAR; OP *kid; const char* useless = NULL; + U32 useless_is_utf8 = 0; SV* sv; U8 want; @@ -1167,6 +1168,7 @@ Perl_scalarvoid(pTHX_ OP *o) SV* msv = sv_2mortal(Perl_newSVpvf(aTHX_ "a constant (%"SVf")", sv)); useless = SvPV_nolen(msv); + useless_is_utf8 = SvUTF8(msv); } else useless = "a constant (undef)"; @@ -1316,7 +1318,9 @@ Perl_scalarvoid(pTHX_ OP *o) return scalar(o); } if (useless) - Perl_ck_warner(aTHX_ packWARN(WARN_VOID), "Useless use of %s in void context", useless); + Perl_ck_warner(aTHX_ packWARN(WARN_VOID), "Useless use of %"SVf" in void context", + newSVpvn_flags(useless, strlen(useless), + SVs_TEMP | ( useless_is_utf8 ? SVf_UTF8 : 0 ))); return o; } @@ -6542,8 +6546,9 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) if (PL_parser && PL_parser->copline != NOLINE) CopLINE_set(PL_curcop, PL_parser->copline); Perl_warner(aTHX_ packWARN(WARN_REDEFINE), - CvCONST(cv) ? "Constant subroutine %s redefined" - : "Subroutine %s redefined", name); + CvCONST(cv) ? "Constant subroutine %"SVf" redefined" + : "Subroutine %"SVf" redefined", + SVfARG(cSVOPo->op_sv)); CopLINE_set(PL_curcop, oldline); } #ifdef PERL_MAD |