diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2006-01-07 23:42:08 +0200 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2006-01-08 12:27:29 +0000 |
commit | afd78fd5455826b5a73217b8c80ab30a9cdad730 (patch) | |
tree | 8da46ba2de3d4958eff6d7f580dc5407ee3023b3 /regcomp.c | |
parent | b6c2855378a705b6278bd4e260febb2b484b9fcd (diff) | |
download | perl-afd78fd5455826b5a73217b8c80ab30a9cdad730.tar.gz |
blead: format warnings
Message-ID: <43C01990.6020207@gmail.com>
p4raw-id: //depot/perl@26708
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -3847,7 +3847,7 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp) if (!SIZE_ONLY && !(flags&HASWIDTH) && max > REG_INFTY/3 && ckWARN(WARN_REGEXP)) { vWARN3(RExC_parse, "%.*s matches null string many times", - RExC_parse - origparse, + (int)(RExC_parse >= origparse ? RExC_parse - origparse : 0), origparse); } @@ -4850,12 +4850,16 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) /* a bad range like a-\d, a-[:digit:] ? */ if (range) { if (!SIZE_ONLY) { - if (ckWARN(WARN_REGEXP)) + if (ckWARN(WARN_REGEXP)) { + int w = + RExC_parse >= rangebegin ? + RExC_parse - rangebegin : 0; vWARN4(RExC_parse, "False [] range \"%*.*s\"", - RExC_parse - rangebegin, - RExC_parse - rangebegin, + w, + w, rangebegin); + } if (prevvalue < 256) { ANYOF_BITMAP_SET(ret, prevvalue); ANYOF_BITMAP_SET(ret, '-'); @@ -5259,12 +5263,16 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) /* a bad range like \w-, [:word:]- ? */ if (namedclass > OOB_NAMEDCLASS) { - if (ckWARN(WARN_REGEXP)) + if (ckWARN(WARN_REGEXP)) { + int w = + RExC_parse >= rangebegin ? + RExC_parse - rangebegin : 0; vWARN4(RExC_parse, "False [] range \"%*.*s\"", - RExC_parse - rangebegin, - RExC_parse - rangebegin, + w, + w, rangebegin); + } if (!SIZE_ONLY) ANYOF_BITMAP_SET(ret, '-'); } else |