[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33314: 27.0.50; wrong compiler warning

From: Andreas Röhler
Subject: bug#33314: 27.0.50; wrong compiler warning
Date: Thu, 8 Nov 2018 17:41:07 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 08.11.2018 16:54, Alan Mackenzie wrote:
Hello, Andreas.

In article <mailman.3649.1541688141.1284.bug-gnu-emacs@gnu.org> you wrote:
Get a compiler Warning: Unused lexical variable ‘regexp’

WRT a form like below:

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))
             (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?

Hi Alan,

that form is used to make a decision at a certain point:

(cond ((and
                     (looking-at regexpvalue))

So regexpvalue is used too. May send the complete function if interested.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]