GNU bug report logs - #31641
26.1; iter-do variable not left unused warning

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 Wellons <wellons@HIDDEN>; Keywords: confirmed; dated Tue, 29 May 2018 13:13:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'minor' from 'normal' Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) confirmed. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 31641) by debbugs.gnu.org; 29 May 2018 22:14:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 29 18:14:06 2018
Received: from localhost ([127.0.0.1]:54382 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fNmsY-0002e7-9V
	for submit <at> debbugs.gnu.org; Tue, 29 May 2018 18:14:06 -0400
Received: from mail-it0-f44.google.com ([209.85.214.44]:54937)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>)
 id 1fNmsR-0002dM-J9; Tue, 29 May 2018 18:14:02 -0400
Received: by mail-it0-f44.google.com with SMTP id 76-v6so5394890itx.4;
 Tue, 29 May 2018 15:13:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=tGpjA5qEZvfZ4KdvhkN99vKZ04cmfk1IwgNmcoVBvow=;
 b=Juw7fa1twUfTJafnbAqqd52lTXZZSPGRArRJLV6g2e8ZNe/gzl005aX/OcXYGQ1ILk
 U+paE5DJRuAmrzGksMTXd3sCOVPUGmM//XcHkECWL+K7zEnTFoAlWDhgB7w4njjHy3Nt
 deeTMQEoBiBiFP9T+NfRqutrXGWww+8t+HV7YQOWbPznX14MJmBR33rE7odajhcwEqjJ
 aZWJe3EEZ9Uxtt9Y6oIRB7Mm8iIEFdxxWGRWmswzis3eJhqSjr1s9eY6bu0R+t0+R1qY
 PZ5Eek0DB2AJq3EMZkegthlaaI0+R3krpMsBJJYbKJpPZpMYOd/xVPjjZBeRqFp4yhw0
 Gi7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=tGpjA5qEZvfZ4KdvhkN99vKZ04cmfk1IwgNmcoVBvow=;
 b=tezXckzbfcvDP/HaOetA5nMsQWlHH3WMjNfSjGMmQuFxgHadiD77dV9kgJWAjaxOcR
 c0xpvPEIgjQ5+rWeFuXWoCG6J3WF/4rYwgAbbrPe8pbE/8h/Kf0PcdWW1Fbh7Zc8zQ7X
 gupoXZfOVWqu1NkuEMonOuE8qBAZRIY9El6pKotTew3zoRLrejrx1HuScwVzyEv3r/Kd
 Nw1EJQEwV0TYoIjMw9CxMvyb2dPH2NGeDKj0OCIFdVoNVoNsMYGlPqj5Eau9CMQ2nuIy
 1OrmeEV3a3q4QiPUJtvu60Gkla6pJh+vEdJ65vSiypQeAiTB92o6oqTOi/24G9DXT4if
 lGbg==
X-Gm-Message-State: ALKqPwdExgkIjHFY0BBQSu8pvstUVz4HBcvvL4YZjAIeQh07jx9iliW3
 mIv56bGMIiYGeFsVucD17qzwZQ==
X-Google-Smtp-Source: ADUXVKJON9BOKrogNOuArMTTtmR3b8+hmdCRNo6ILcSdG2oeOvA/9K5vj9uSMmc3/gFezOMpt2rJOw==
X-Received: by 2002:a6b:e90d:: with SMTP id u13-v6mr214635iof.22.1527632033652; 
 Tue, 29 May 2018 15:13:53 -0700 (PDT)
Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id
 q21-v6sm11171672itb.4.2018.05.29.15.13.52
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Tue, 29 May 2018 15:13:52 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: Christopher Wellons <wellons@HIDDEN>
Subject: Re: bug#31641: 26.1; iter-do variable not left unused warning
References: <20180529131230.kijx2bkcvcqsyhgg@HIDDEN>
Date: Tue, 29 May 2018 18:13:50 -0400
In-Reply-To: <20180529131230.kijx2bkcvcqsyhgg@HIDDEN> (Christopher
 Wellons's message of "Tue, 29 May 2018 09:12:30 -0400")
Message-ID: <87in76cdpd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 31641
Cc: 31641 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 31641 + confirmed
severity 31641 minor
quit

Christopher Wellons <wellons@HIDDEN> writes:

> When byte-compiling an iter-do form with a variable intended to be
> left unused, the compiler emits a false warning:
>
> ;;; -*- lexical-binding: t; -*-
> (require 'generator)
> (iter-do (_ i))
> ;; -> "Warning: variable =E2=80=98_=E2=80=99 not left unused"

Looking at the expansion, I guess the setf should be dropped if the
variable name starts with _.

(let (_
      #3=3D#:iter-do-result11
      (#1=3D#:iter-do-iterator-done8 nil)
      (#2=3D#:iter-do-iterator10 i))
  (while (not #1#)
    (condition-case #4=3D#:iter-do-condition9
        (setf _ (iter-next #2#))
      (iter-end-of-sequence
       (setf #3# (cdr #4#))
       (setf #1# t)))
    (unless #1#))
  #3#)




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

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


Received: (at submit) by debbugs.gnu.org; 29 May 2018 13:12:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 29 09:12:45 2018
Received: from localhost ([127.0.0.1]:53279 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fNeQf-0004ah-Mj
	for submit <at> debbugs.gnu.org; Tue, 29 May 2018 09:12:45 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56568)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wellons@HIDDEN>) id 1fNeQe-0004aV-NL
 for submit <at> debbugs.gnu.org; Tue, 29 May 2018 09:12:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <wellons@HIDDEN>) id 1fNeQY-0007F5-Ru
 for submit <at> debbugs.gnu.org; Tue, 29 May 2018 09:12:39 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:49559)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <wellons@HIDDEN>)
 id 1fNeQY-0007Ez-NQ
 for submit <at> debbugs.gnu.org; Tue, 29 May 2018 09:12:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47535)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <wellons@HIDDEN>) id 1fNeQX-000083-OR
 for bug-gnu-emacs@HIDDEN; Tue, 29 May 2018 09:12:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <wellons@HIDDEN>) id 1fNeQT-0007Cu-On
 for bug-gnu-emacs@HIDDEN; Tue, 29 May 2018 09:12:37 -0400
Received: from mail.nullprogram.com ([192.241.191.137]:41964)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <wellons@HIDDEN>)
 id 1fNeQT-0007C9-L4
 for bug-gnu-emacs@HIDDEN; Tue, 29 May 2018 09:12:33 -0400
Received: from nullprogram.com (localhost [127.0.0.1])
 by mail.nullprogram.com (Postfix) with ESMTPS id D9AA9C0A34
 for <bug-gnu-emacs@HIDDEN>; Tue, 29 May 2018 09:12:31 -0400 (EDT)
Date: Tue, 29 May 2018 09:12:30 -0400
From: Christopher Wellons <wellons@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 26.1; iter-do variable not left unused warning
Message-ID: <20180529131230.kijx2bkcvcqsyhgg@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Disposition: inline
User-Agent: NeoMutt/20170113 (1.7.2)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

When byte-compiling an iter-do form with a variable intended to be left=20
unused, the compiler emits a false warning:

;;; -*- lexical-binding: t; -*-
(require 'generator)
(iter-do (_ i))
;; -> "Warning: variable =E2=80=98_=E2=80=99 not left unused"

Giving the variable a name has the opposite effect, though it's not=20
a false warning in this case:

(iter-do (v i))
;; -> "Unused lexical variable =E2=80=98v=E2=80=99"

This issue does not occur with similar, long-established forms:

;;; -*- lexical-binding: t; -*-
(dolist (_ '(a b c)))
(dotimes (_ 10))
;; -> no warnings




Acknowledgement sent to Christopher Wellons <wellons@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#31641; 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: Tue, 29 May 2018 22:30:02 UTC

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