From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#28107: 26.0.50; Byte compilation shows an unused var warning for an used variable Date: Wed, 16 Aug 2017 15:11:47 +0900 Message-ID: <87d17wyrbw.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1502864003 10911 195.159.176.226 (16 Aug 2017 06:13:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 16 Aug 2017 06:13:23 +0000 (UTC) To: 28107@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 16 08:13:18 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhrZq-0002Oz-Kn for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Aug 2017 08:13:14 +0200 Original-Received: from localhost ([::1]:53393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhrZx-0005Oz-6c for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Aug 2017 02:13:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhrZj-0005LT-Qy for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2017 02:13:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhrZe-00087b-T9 for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2017 02:13:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59703) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dhrZe-00087X-PW for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2017 02:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dhrZe-0007lW-EM for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2017 02:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Aug 2017 06:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28107 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.150286393129792 (code B ref -1); Wed, 16 Aug 2017 06:13:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Aug 2017 06:12:11 +0000 Original-Received: from localhost ([127.0.0.1]:40151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhrYo-0007kR-R6 for submit@debbugs.gnu.org; Wed, 16 Aug 2017 02:12:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhrYn-0007kE-1F for submit@debbugs.gnu.org; Wed, 16 Aug 2017 02:12:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhrYg-00080w-Pj for submit@debbugs.gnu.org; Wed, 16 Aug 2017 02:12:03 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57362) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dhrYg-00080s-Mp for submit@debbugs.gnu.org; Wed, 16 Aug 2017 02:12:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhrYf-0004nx-K7 for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2017 02:12:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhrYa-0007zw-Ik for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2017 02:12:01 -0400 Original-Received: from mail-pg0-x230.google.com ([2607:f8b0:400e:c05::230]:38040) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dhrYa-0007ze-Bl for bug-gnu-emacs@gnu.org; Wed, 16 Aug 2017 02:11:56 -0400 Original-Received: by mail-pg0-x230.google.com with SMTP id l64so18612080pge.5 for ; Tue, 15 Aug 2017 23:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=8y5OfQBTsqmUYXQN9xpRal4ZJ+wJVzxsmCbbM90lPj4=; b=UfR8Q70vjiTvr/xvLAyTI+lyhu7XV26ClZMQtpTkWYtYHAAeajU0j08TMI1veJJeg6 RYeoOVyXXq6Q8OC3HGQE+p6fnKOrtksJxxaTJsbUO5GQcqKMSmO++5QFCnRlZThxZiKN lFMyi/1sCEwn5ZXdnkFO732X5y19AIR65GZ1zwGq8naiQ0LRcLzea0KP9UirJrhknndN v4mqg0jd9DbevD/hhCFkothgFIsiIJQLLSK7yndeyYx7m89Vsl7mD0jhq68u7g39BfmC YpfWytHMX/fs1QQcX8ed8WrtCQu+y/3O01DxMhujnaPSMEzXn/A+q9GYZfeSg4ckUVXw DNIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=8y5OfQBTsqmUYXQN9xpRal4ZJ+wJVzxsmCbbM90lPj4=; b=ZhS4uter5Heciq5rPnbbSt3FB8S04p/7KqckA4cO45axKHZ565lLDHijOCEEuzm/4o PHoZc9cupazxUpp5CJ/XNS2IoQooj0aAB/bA6SwGvbagyta1Q9ec7ME/Dg9mOw0yimR0 uTIi111lAJqp7hE4xmjNakAFFQnaN3AFhsT70z/utCpuNmjnUCyntGFINJXGy3KExNt/ s8UHRBbpBo4Q+87sAHJeuEQLO6wCGZKNUK74N6O4UpVqUh0gK+lajSOjU7ZBsdVt7Q0n Rfx9WNGSS9Hlh1oIz7XFfcoC5r4ENzIqKTAsWWbvKc9ea/RbqBzEfAKlnhOHfHo4Jr6K htag== X-Gm-Message-State: AHYfb5jrWav9OOyl2gIRQm9UQUpwv6WnE4vSIEyxOwGMMb3Qqbzi9vR+ 7y23LseN5OJExkYy X-Received: by 10.98.204.136 with SMTP id j8mr587642pfk.275.1502863913695; Tue, 15 Aug 2017 23:11:53 -0700 (PDT) Original-Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id a63sm222709pfc.165.2017.08.15.23.11.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 Aug 2017 23:11:52 -0700 (PDT) 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.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135801 Archived-At: Write a file '/tmp/test.el' with following content: --8<-----------------------------cut here---------------start------------->8--- ;; -*- lexical-binding: t; -*- ;; Compiles OK (defun test () (let ((lst (list "foo" 1))) (when (cdr lst) (equal (cdr lst) 1)))) ;; Compiles OK (defun getval (x) (cdr x)) (defun test3 () (let ((alist (list (cons "foo" 1) (cons "bar" 2)))) (dolist (x alist) (when (getval x) (equal (getval x) (alist-get (car x) alist)))))) ;; Warning: value returned from (cdr x) is unused (defun test2 () (let ((alist (list (cons "foo" 1) (cons "bar" 2)))) (dolist (x alist) (when (cdr x) (equal (cdr x) (alist-get (car x) alist)))))) --8<-----------------------------cut here---------------end--------------->8--- emacs -Q M-x byte-compile-file /tmp/test.el RET I got a warning from test2 func: Warning: value returned from (cdr x) is unused But the value is used as the `when' condition, and as `equal' 1st argument. In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-08-16 Repository revision: 3305dec5387021791eb09a93df5ab784b2297dc8