From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4106 invoked by alias); 2 Feb 2017 07:37:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40484 Received: (qmail 3431 invoked from network); 2 Feb 2017 07:37:24 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(-0.7/5.0):. Processed in 0.953987 secs); 02 Feb 2017 07:37:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: ynnor@mm.st X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.messagingengine.com designates 66.111.4.25 as permitted sender) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=mm.st; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=sip1pfZ9WYHad+/BXJiJycMid6M=; b=LhxtJ21wGN86jrstwoTIq aLR8VOSfag1m11STEYQCbzAtgz/DpkqbdKohtFuMxWGf5uXV7IRsMFAZmtHQN0cK AdnKom5FpzkNEaY2csw17cgCK1ZkFg1a+u+zU8flPnnt5+seKG6KFS2kdTMb8fRQ AGPG7ru9UicZDA/1yD0DJU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=smtpout; bh=sip1pfZ9WYHad+/BXJiJycMid 6M=; b=Z1kQX19DsTBaZ5SPkS5DfxDWMhUzsPr4jZd5dx2ECiqPqeGT2LmqFgySu Fzfv2BHA2BkEoQ52vQ8kmzZqFk1q9l21pnlTyzeRwMtAJQE78szoaRATDVCGG4iR Itzg0KD7R10xqkib1rOAKftsStybw+uXZx2HVcYp/vkOFcXqkk= X-ME-Sender: Message-Id: <1486021036.1782934.867696784.0FCB3E9A@webmail.messagingengine.com> From: Ronald Fischer To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - html Subject: Bug in regexp operator when warn_create_global is in effect Date: Thu, 02 Feb 2017 08:37:16 +0100 Consider the following program: #!/bin/zsh function f { [[ x =~ x ]] } setopt warn_create_global f When run by zsh 5.2 (x86_64-ubuntu-linux-gnu), I get the error messages: f:1: scalar parameter MATCH created globally in function f f:1: numeric parameter MBEGIN created globally in function f f:1: numeric parameter MEND created globally in function f While it is correct, that regexp matching sets, as side effect, the variables mentioned here, it doesn't, IMHO, make much sense that a zsh user, who not even *uses* these variables, receives these error messages. If the user had to pay attention to those variables which automatically spring into existence by zsh language constructs, doing a cd inside a function should equally well raise the message "parameter OLDPWD created globally in function". I suggest that the variables MATCH, MBEGIN and MEND are already created by zsh as global parameters during shell startup time. This would not trigger the warning, if someone uses regexp matching inside functions. Ronald