unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: "Andreas Röhler" <andreas.roehler@online.de>
Cc: 33314@debbugs.gnu.org
Subject: bug#33314: 27.0.50; wrong compiler warning
Date: 8 Nov 2018 15:54:59 -0000	[thread overview]
Message-ID: <20181108155459.99206.qmail@mail.muc.de> (raw)
In-Reply-To: <mailman.3649.1541688141.1284.bug-gnu-emacs@gnu.org>

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






  parent reply	other threads:[~2018-11-08 15:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08 14:38 bug#33314: 27.0.50; wrong compiler warning Andreas Röhler
     [not found] ` <mailman.3649.1541688141.1284.bug-gnu-emacs@gnu.org>
2018-11-08 15:54   ` Alan Mackenzie [this message]
2018-11-08 16:41     ` Andreas Röhler
2018-11-09  1:11       ` Noam Postavsky
2018-11-09  8:35         ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181108155459.99206.qmail@mail.muc.de \
    --to=acm@muc.de \
    --cc=33314@debbugs.gnu.org \
    --cc=andreas.roehler@online.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).