GNU bug report logs - #12369
24.2.50; cl-loop: variable not left unused

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Christopher Schmidt <christopher@HIDDEN>; dated Thu, 6 Sep 2012 13:16:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Sep 2012 15:43:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 06 11:43:37 2012
Received: from localhost ([127.0.0.1]:44349 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T9eEy-0007zJ-MF
	for submit <at> debbugs.gnu.org; Thu, 06 Sep 2012 11:43:37 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45974)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <monnier@HIDDEN>) id 1T9eEw-0007zC-Ux
	for submit <at> debbugs.gnu.org; Thu, 06 Sep 2012 11:43:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <monnier@HIDDEN>) id 1T9eEe-0004Wt-Pg
	for submit <at> debbugs.gnu.org; Thu, 06 Sep 2012 11:43:22 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:51112)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <monnier@HIDDEN>) id 1T9eEe-0004Wp-Mu
	for submit <at> debbugs.gnu.org; Thu, 06 Sep 2012 11:43:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56129)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <monnier@HIDDEN>) id 1T9eEZ-00061v-VB
	for bug-gnu-emacs@HIDDEN; Thu, 06 Sep 2012 11:43:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <monnier@HIDDEN>) id 1T9eEU-0004Vs-5b
	for bug-gnu-emacs@HIDDEN; Thu, 06 Sep 2012 11:43:11 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:61262)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <monnier@HIDDEN>) id 1T9eEU-0004Vo-13
	for bug-gnu-emacs@HIDDEN; Thu, 06 Sep 2012 11:43:06 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09FpYew/2dsb2JhbAA7CbBIg0mBCIIVAQEEAVYoCws0EhQYDYhABboJixiCDoMeA6MzgViDBQ
X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="197708680"
Received: from 69-165-135-176.dsl.teksavvy.com (HELO pastel.home)
	([69.165.135.176])
	by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
	06 Sep 2012 11:43:04 -0400
Received: by pastel.home (Postfix, from userid 20848)
	id 252E158B33; Thu,  6 Sep 2012 11:43:04 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Re: bug#12369: 24.2.50; cl-loop: variable not left unused
Message-ID: <jwva9x3tb59.fsf-monnier+emacs@HIDDEN>
References: <87d31z1ets@HIDDEN>
Date: Thu, 06 Sep 2012 11:43:04 -0400
In-Reply-To: <87d31z1ets@HIDDEN> (Christopher Schmidt's message of
	"Thu,  6 Sep 2012 14:06:05 +0100 (BST)")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.2 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.2 (------)

>     ;; -*- lexical-binding: t -*-
>     (require 'cl-lib)
>     (cl-loop for (rms . emacs) in nil)
> Byte compile this piece of code.
>     Warning: Unused lexical variable `rms'

Yes, first bug: `emacs' is not listed as unused.

> Attempting to fix this warning by renaming rms to _rms results in
> another warning.
>     Warning: variable `_rms' not left unused

Yup, second bug.

This is all due to the code generated by cl-loop which was optimized to
use `set' in the loop instead of `let'.  This made sense for dynamically
scoped code where `let' is a bit slower, but for lexically-scoped code,
it's the exact opposite, so we should change the generated code from:

   (identity
    (catch '--cl-block-nil--
      (let* ((--cl-var-- nil)
             (emacs nil) (rms nil))
        (while (consp --cl-var--)
          (setq emacs (car --cl-var--) rms (pop emacs))
          (setq --cl-var-- (cdr --cl-var--)))
        nil)))
to
   (identity
    (catch '--cl-block-nil--
      (let* ((--cl-var-- nil))
        (while (consp --cl-var--)
          (let* ((tmp (car --cl-var--))
                 (emacs (car tmp))
                 (rms (cdr tmp)))
            (setq --cl-var-- (cdr --cl-var--))))
        nil)))


-- Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#12369; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Sep 2012 13:15:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 06 09:15:54 2012
Received: from localhost ([127.0.0.1]:42609 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1T9bvx-0003Kl-Jj
	for submit <at> debbugs.gnu.org; Thu, 06 Sep 2012 09:15:53 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50884)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <christopher@HIDDEN>) id 1T9bvo-0003KM-LV
	for submit <at> debbugs.gnu.org; Thu, 06 Sep 2012 09:15:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1T9bvT-0004bw-KB
	for submit <at> debbugs.gnu.org; Thu, 06 Sep 2012 09:15:28 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
	T_DKIM_INVALID autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:33907)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1T9bvT-0004U8-F9
	for submit <at> debbugs.gnu.org; Thu, 06 Sep 2012 09:15:19 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43946)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1T9bmh-0004YC-1u
	for bug-gnu-emacs@HIDDEN; Thu, 06 Sep 2012 09:06:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1T9bma-00020u-2E
	for bug-gnu-emacs@HIDDEN; Thu, 06 Sep 2012 09:06:14 -0400
Received: from ristopher.com ([146.185.21.93]:55145
	helo=saturn.ch.ristopher.com) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <christopher@HIDDEN>) id 1T9bmZ-0001yl-QC
	for bug-gnu-emacs@HIDDEN; Thu, 06 Sep 2012 09:06:07 -0400
Received: by saturn.ch.ristopher.com (Postfix, from userid 0)
	id C681420D4F; Thu,  6 Sep 2012 14:06:05 +0100 (BST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ch.ristopher.com;
	s=mail; t=1346936765;
	bh=r50r0wtAcU7b0CMQ3H26cWbvdctmsKqGWXP9yV0GraM=;
	h=From:To:Subject:Message-ID:MIME-Version:Content-Type:Date;
	b=OYaS2y/lcmHttsOjU9hoHnAUF48QBt8cigHqve+P9GBRSvL+wJTD+PzQ8KA2vpnS9
	itleeJ3pdWXaHeev78SsEayIfotRyLnoz27W6vRh+rk4IjfTnNueNIMMjcQytwjKla
	h3NO9TV4VKsIZykz1RMHaOOHkkRrqUoqMF815HHk=
From: Christopher Schmidt <christopher@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.2.50; cl-loop: variable not left unused
Message-ID: <87d31z1ets@HIDDEN>
Mail-Followup-To: bug-gnu-emacs@HIDDEN
MIME-Version: 1.0
Content-Type: text/plain
Date: Thu,  6 Sep 2012 14:06:05 +0100 (BST)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

severity: minor

    ;; -*- lexical-binding: t -*-

    (require 'cl-lib)
    (cl-loop for (rms . emacs) in nil)

Byte compile this piece of code.

    Warning: Unused lexical variable `rms'

Attempting to fix this warning by renaming rms to _rms results in
another warning.

    Warning: variable `_rms' not left unused

GNU Emacs 24.2.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of
2012-09-06.

        Christopher




Acknowledgement sent to Christopher Schmidt <christopher@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#12369; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.