From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#33314: 27.0.50; wrong compiler warning Date: 8 Nov 2018 15:54:59 -0000 Organization: muc.de e.V. Message-ID: <20181108155459.99206.qmail@mail.muc.de> References: <7ec0dc92-8e02-2060-3ca8-234ac3d7440e@online.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1541692487 6369 195.159.176.226 (8 Nov 2018 15:54:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Nov 2018 15:54:47 +0000 (UTC) User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.2-RELEASE-p4 (amd64)) Cc: 33314@debbugs.gnu.org To: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 08 16:54:43 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKmdm-0001ZH-SM for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Nov 2018 16:54:42 +0100 Original-Received: from localhost ([::1]:57608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKmft-0004a5-Fp for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Nov 2018 10:56:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKmfA-0004D6-Cv for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2018 10:56:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKmf4-0006di-LQ for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2018 10:56:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gKmf4-0006d4-GV for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2018 10:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gKmf4-00012v-DS for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2018 10:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Nov 2018 15:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33314 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33314-submit@debbugs.gnu.org id=B33314.15416925023946 (code B ref 33314); Thu, 08 Nov 2018 15:56:02 +0000 Original-Received: (at 33314) by debbugs.gnu.org; 8 Nov 2018 15:55:02 +0000 Original-Received: from localhost ([127.0.0.1]:41835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKme6-00011a-FS for submit@debbugs.gnu.org; Thu, 08 Nov 2018 10:55:02 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:48651 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1gKme4-000117-HO for 33314@debbugs.gnu.org; Thu, 08 Nov 2018 10:55:01 -0500 Original-Received: (qmail 99207 invoked by uid 3782); 8 Nov 2018 15:54:59 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152168 Archived-At: Hello, Andreas. In article you wrote= : > Get a compiler Warning: Unused lexical variable =E2=80=98regexp=E2=80=99 > WRT a form like below: > (defun foo (regexp &optional something) > "..." > (unless (bobp) > (when (empty-line-p) (skip-chars-backward " \t\r\n\f")) > (let* ((orig (point)) > (regexpvalue (if (eq regexp 'py-clause-re) (symbol-value=20 > 'py-extended-block-or-clause-re) (symbol-value regexp))) > ... Reformatting that to make things clearer: (defun foo (regexp &optional something) "..." (unless (bobp) (when (empty-line-p) (skip-chars-backward " \t\r\n\f")) (let* ((orig (point)) (regexpvalue (if (eq regexp 'py-clause-re) (symbol-value 'py-extended-block-or-clause-re) (symbol-value regexp))) > ;; > As visible, regexp is evaluated in last clause. Does the rest of that let* form use regexpvalue? If not, the lack of use of regexpvalue will, I believe, transfer to regexp. Incidentally, why write (symbol-value 'py-extended-block-or-clause-re) rather than just py-extended-block-or-clause-re? > Thanks, > Andreas > GNU Emacs 27.0.50 (build 1, i686-pc-linux-gnu, GTK+ Version 3.14.5) of=20 > 2018-10-13 --=20 Alan Mackenzie (Nuremberg, Germany).