From b78a1974184592bd724e6c3f7a8b1e7d7aa63056 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Sat, 9 Nov 2013 12:14:37 +0000 Subject: [PATCH] porting/diag.t: restrict what's a warn function 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/porting/diag.t b/t/porting/diag.t index 83e74de..8dece71 100644 --- a/t/porting/diag.t +++ b/t/porting/diag.t @@ -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 ) -- 2.7.4