From patchwork Fri Jul 6 13:29:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 940502 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-94076-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="ue2RLimV"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41MbDg0rdPz9s4c for ; Fri, 6 Jul 2018 23:29:38 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= adbDJdNbZpesnXx3HHnQ8+qMHjpipnu/JTN4hIC2meeyXqpjy+p/13WGcheoY+9L pTVuhevc6U8xl9qjs+YNmIzxQPLVObV6kuI4zunTBMtQ1JJIYnVlO3GQi2ddzAPB EzK9Nd6d4U57iN4av+m29ysHQZb9OBDpHsHF9VWnRAs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=E78gQj empHK0uHZvteyzvpXkdo8=; b=ue2RLimVH8DalQzvo8Kzy74SIiJuIC6L92lO4O xMlBrlSI+cV/DVyGW/GqPq/AB3eCRpY4Ig9l7KgzofsslVad1QINgheVoxpIjnnw gE7mfy8F310zKOC9cE3cgU3y/T/B/ESbm4BLmnNMlQ9SKLy+wVrreXrKjRrbXDt4 /ugz8= Received: (qmail 10693 invoked by alias); 6 Jul 2018 13:29:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 10682 invoked by uid 89); 6 Jul 2018 13:29:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=braces, 6447 X-HELO: mx1.redhat.com Date: Fri, 06 Jul 2018 15:29:27 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] conform/conformtest.pl: Escape literal braces in regular expressions User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20180706132927.DA37843994575@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) This suppresses Perl warnings like these: Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.32), passed through in regex; marked by <-- HERE in m/^element *({ <-- HERE ([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/ at conformtest.pl line 370. 2018-07-06 Florian Weimer * conform/conformtest.pl (checknamespace): Escape literal braces in regular expressions. Reviewed-by: Carlos O'Donell diff --git a/conform/conformtest.pl b/conform/conformtest.pl index cb500f0e76..a4ef756105 100644 --- a/conform/conformtest.pl +++ b/conform/conformtest.pl @@ -367,7 +367,7 @@ while ($#headers >= 0) { s/^optional-//; $optional = 1; } - if (/^element *({([^}]*)}|([^{ ]*)) *({([^}]*)}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) { + if (/^element *(\{([^}]*)\}|([^{ ]*)) *(\{([^}]*)\}|([^{ ]*)) *([A-Za-z0-9_]*) *(.*)/) { my($struct) = "$2$3"; my($type) = "$5$6"; my($member) = "$7"; @@ -556,7 +556,7 @@ while ($#headers >= 0) { "Symbol \"$symbol\" has not the right value.", $res, $xfail); } - } elsif (/^type *({([^}]*)|([a-zA-Z0-9_]*))/) { + } elsif (/^type *(\{([^}]*)|([a-zA-Z0-9_]*))/) { my($type) = "$2$3"; my($maybe_opaque) = 0; @@ -586,7 +586,7 @@ while ($#headers >= 0) { ? "NOT AVAILABLE" : "Type \"$type\" not available."), $missing, $optional, $xfail); - } elsif (/^tag *({([^}]*)|([a-zA-Z0-9_]*))/) { + } elsif (/^tag *(\{([^}]*)|([a-zA-Z0-9_]*))/) { my($type) = "$2$3"; # Remember that this name is allowed. @@ -607,7 +607,7 @@ while ($#headers >= 0) { compiletest ($fnamebase, "Testing for type $type", "Type \"$type\" not available.", $missing, 0, $xfail); - } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) { + } elsif (/^function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) { my($rettype) = "$2$3"; my($fname) = "$4"; my($args) = "$5"; @@ -644,7 +644,7 @@ while ($#headers >= 0) { "Function \"$fname\" has incorrect type.", $res, 0, $xfail); } - } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { + } elsif (/^function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { my($rettype) = "$2$3"; my($fname) = "$4"; my($args) = "$5"; @@ -681,7 +681,7 @@ while ($#headers >= 0) { "Function \"$fname\" has incorrect type.", $res, 0, $xfail); } - } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) *(.*)/) { + } elsif (/^variable *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) *(.*)/) { my($type) = "$2$3"; my($vname) = "$4"; my($rest) = "$5"; @@ -713,7 +713,7 @@ while ($#headers >= 0) { compiletest ($fnamebase, "Test for type of variable $fname", "Variable \"$vname\" has incorrect type.", $res, 0, $xfail); - } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { + } elsif (/^macro-function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { my($rettype) = "$2$3"; my($fname) = "$4"; my($args) = "$5"; @@ -812,11 +812,11 @@ while ($#headers >= 0) { s/^xfail(\[([^\]]*)\])?-//; s/^optional-//; - if (/^element *({([^}]*)}|([^ ]*)) *({([^}]*)}|([^ ]*)) *([A-Za-z0-9_]*) *(.*)/) { + if (/^element *(\{([^}]*)\}|([^ ]*)) *(\{([^}]*)\}|([^ ]*)) *([A-Za-z0-9_]*) *(.*)/) { push @allow, $7; } elsif (/^(macro|constant|macro-constant|macro-int-constant) +([a-zA-Z0-9_]*) *(?:{([^}]*)} *)?(?:([>== 0) { } else { push @allow, $type; } - } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) { + } elsif (/^function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) [(][*]([a-zA-Z0-9_]*) ([(].*[)])/) { push @allow, $4; - } elsif (/^function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { + } elsif (/^function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { push @allow, $4; - } elsif (/^variable *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) { + } elsif (/^variable *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*)/) { push @allow, $4; - } elsif (/^macro-function *({([^}]*)}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { + } elsif (/^macro-function *(\{([^}]*)\}|([a-zA-Z0-9_]*)) ([a-zA-Z0-9_]*) ([(].*[)])/) { push @allow, $4; } elsif (/^symbol *([a-zA-Z0-9_]*) *([A-Za-z0-9_-]*)?/) { push @allow, $1;