porting/diag.t: restrict what's a warn function
authorDavid Mitchell <davem@iabyn.com>
Sat, 9 Nov 2013 12:14:37 +0000 (12:14 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 9 Nov 2013 13:09:56 +0000 (13:09 +0000)
add a couple of judicious \b's so that while warn() etc are seen
as calls to a warn-related function, this_is_not_a_warn() etc aren't.

This is needed for the next commit which will introduce the macro
NV_ne_nowarn().

t/porting/diag.t

index 83e74de..8dece71 100644 (file)
@@ -234,7 +234,7 @@ sub check_file {
 
     my $multiline = 0;
     # Loop to accumulate the message text all on one line.
-    if (m/(?:$source_msg_re(?:_nocontext)?|$regcomp_re)\s*\(/) {
+    if (m/\b(?:$source_msg_re(?:_nocontext)?|$regcomp_re)\s*\(/) {
       while (not m/\);$/) {
         my $nextline = <$codefh>;
         # Means we fell off the end of the file.  Not terribly surprising;
@@ -266,7 +266,7 @@ sub check_file {
     # diag($_);
     # DIE is just return Perl_die
     my ($name, $category, $routine);
-    if (/$source_msg_call_re/) {
+    if (/\b$source_msg_call_re/) {
       ($name, $category, $routine) = ($+{'text'}, $+{'category'}, $+{'routine'});
       # Sometimes the regexp will pick up too much for the category
       # e.g., WARN_UNINITIALIZED), PL_warn_uninit_sv ... up to the next )