summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-01-07 23:42:08 +0200
committerH.Merijn Brand <h.m.brand@xs4all.nl>2006-01-08 12:27:29 +0000
commitafd78fd5455826b5a73217b8c80ab30a9cdad730 (patch)
tree8da46ba2de3d4958eff6d7f580dc5407ee3023b3 /regcomp.c
parentb6c2855378a705b6278bd4e260febb2b484b9fcd (diff)
downloadperl-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.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/regcomp.c b/regcomp.c
index 83b9015373..86b9140b9f 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -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