bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#33314: 27.0.50; wrong compiler warning


From: Alan Mackenzie
Subject: bug#33314: 27.0.50; wrong compiler warning
Date: 8 Nov 2018 15:54:59 -0000
User-agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.2-RELEASE-p4 (amd64))

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:

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

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 
> 2018-10-13

-- 
Alan Mackenzie (Nuremberg, Germany).






reply via email to

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