From: Rafael Garcia-Suarez Date: Wed, 27 Mar 2002 13:32:00 +0000 (+0100) Subject: A warning wasn't turnable off X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cd84f5b283c99b286b4dbd0ab70732e43d1eb320;p=p5sagit%2Fp5-mst-13.2.git A warning wasn't turnable off Message-ID: <20020327133200.A18945@rafael> p4raw-id: //depot/perl@15547 --- diff --git a/regcomp.c b/regcomp.c index 639f140..12f9016 100644 --- a/regcomp.c +++ b/regcomp.c @@ -3483,7 +3483,10 @@ S_checkposixcc(pTHX_ RExC_state_t *pRExC_state) while(*s && isALNUM(*s)) s++; if (*s && c == *s && s[1] == ']') { - vWARN3(s+2, "POSIX syntax [%c %c] belongs inside character classes", c, c); + if (ckWARN(WARN_REGEXP)) + vWARN3(s+2, + "POSIX syntax [%c %c] belongs inside character classes", + c, c); /* [[=foo=]] and [[.foo.]] are still future. */ if (POSIXCC_NOTYET(c)) { diff --git a/t/lib/warnings/regcomp b/t/lib/warnings/regcomp index db44eca..e9a8d70 100644 --- a/t/lib/warnings/regcomp +++ b/t/lib/warnings/regcomp @@ -20,7 +20,7 @@ /%.127s/: Unrecognized escape \\%c passed through [S_regatom] $x = '\m' ; /$x/ - POSIX syntax [%c %c] is reserved for future extensions [S_checkposixcc] + POSIX syntax [%c %c] belongs inside character classes [S_checkposixcc] Character class [:%.*s:] unknown [S_regpposixcc] @@ -62,15 +62,12 @@ use warnings 'regexp' ; $_ = "" ; /[:alpha:]/; /[:zog:]/; -/[[:zog:]]/; no warnings 'regexp' ; /[:alpha:]/; /[:zog:]/; -/[[:zog:]]/; EXPECT POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:alpha:] <-- HERE / at - line 5. POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:zog:] <-- HERE / at - line 6. -POSIX class [:zog:] unknown in regex; marked by <-- HERE in m/[[:zog:] <-- HERE ]/ ######## # regcomp.c [S_checkposixcc] # @@ -83,16 +80,6 @@ EXPECT POSIX syntax [. .] belongs inside character classes in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5. POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[.zog.] <-- HERE / ######## -# regcomp.c [S_checkposixcc] -# -use warnings 'regexp' ; -$_ = "" ; -/[[.zog.]]/; -no warnings 'regexp' ; -/[[.zog.]]/; -EXPECT -POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[[.zog.] <-- HERE ]/ -######## # regcomp.c [S_regclass] $_ = ""; use warnings 'regexp' ;