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: Fri, 18 Aug 2017 02:32:59 +0900 (JST) Message-ID: References: <87d17wyrbw.fsf@calancha-pc> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1502991258 32385 195.159.176.226 (17 Aug 2017 17:34:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 17 Aug 2017 17:34:18 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: 28107@debbugs.gnu.org, Tino Calancha To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 17 19:34:14 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 1diOgI-0007sM-Ps for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Aug 2017 19:34:06 +0200 Original-Received: from localhost ([::1]:37055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diOgP-0001VC-GY for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Aug 2017 13:34:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diOgI-0001Te-NG for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 13:34:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diOgE-0004uh-EV for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 13:34:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34378) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1diOgE-0004ub-BU for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 13:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1diOgE-00045Y-2I for bug-gnu-emacs@gnu.org; Thu, 17 Aug 2017 13:34: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: Thu, 17 Aug 2017 17:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28107 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28107-submit@debbugs.gnu.org id=B28107.150299119115658 (code B ref 28107); Thu, 17 Aug 2017 17:34:02 +0000 Original-Received: (at 28107) by debbugs.gnu.org; 17 Aug 2017 17:33:11 +0000 Original-Received: from localhost ([127.0.0.1]:43059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diOfP-00044U-25 for submit@debbugs.gnu.org; Thu, 17 Aug 2017 13:33:11 -0400 Original-Received: from mail-pg0-f67.google.com ([74.125.83.67]:34299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diOfN-00044G-3v for 28107@debbugs.gnu.org; Thu, 17 Aug 2017 13:33:09 -0400 Original-Received: by mail-pg0-f67.google.com with SMTP id y192so10893819pgd.1 for <28107@debbugs.gnu.org>; Thu, 17 Aug 2017 10:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=mIcLoeHsO0QHM1Wf09Z+CBGbw561TtvNq0TLavJIiW4=; b=YJOiYUHaG6tBIgKffEoPjdMi07joeS8HUzQVfvsC1/RV45ArIcvAPl4kRc64aJafd5 dnqDTc/PJaK1K6SPp6dmmYAO1f/zJglhL19TaETqDUg0TpahQVa5NwaRuPZWseI1RzVB IszXhZEQcjhFclBK3SGJ/tQFwXmNdjDACle1uE/UOfJdtCEQAJs5nGAuyGsdJRSvA9tQ r9ABNXso03vC8ML8OZI0Sxyu7fwtZS4mvG3akj+nVorYlW9wUxH84FzNk2r8MjyajEXX hY30U34Rm4Iol+2q7b4PbLuZOEJdYz2iSswyXBfEnqLfI37E6wnIocNlnGSUnIXlmy3Z cp2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=mIcLoeHsO0QHM1Wf09Z+CBGbw561TtvNq0TLavJIiW4=; b=qjVa+p7SluFkslzg9zaqXkj+hO4YV7y4zsJDgU0bv9wQnw+v10ePrmH6Opjgr24kly lhry9tI+CKeMTlvygJ4w6OCz51yfMc/JMmwzNFth+CIvPS3LMz99kj8WNkU3NouHMQ9+ hEZFu1NP6zRhmKTfaBKfbH9ScusdbBjky6rR/CvLz2tk1ha0ATFOFok/u+CQFhZf7/18 RBEVNqS61l80HjE70KUv+9dsIPu2cH1wn+DJYV8HERHmYYEo2vFebh9GTNh69STBOSog bN6wFsjF6JE/pgMeCfZyk6Dx2jOJkh0+MVgcC8744n9xsBlMpfvhQ0l2ciOO1gAvXiLG ZaHQ== X-Gm-Message-State: AHYfb5gP8mk3RIIyC8ZQ9vwm4yKSzi0JAAcvU9/mys6T+nq3NhmeHSpo stZT5YRbjDUSWQ== X-Received: by 10.84.245.8 with SMTP id i8mr6979394pll.264.1502991182958; Thu, 17 Aug 2017 10:33:02 -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 f80sm8276717pfd.115.2017.08.17.10.33.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Aug 2017 10:33:02 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: 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:135880 Archived-At: On Thu, 17 Aug 2017, Glenn Morris wrote: > Tino Calancha wrote: > >> ;; 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)))))) > > Isn't this function a no-op? > Eg dolist does not return the last value from the body. > So a smaller example of the same thing is: > > (dolist (x '(1)) > (equal (+ x 2) 3)) > > which returns nil. Even without the dolist we get such warning: $> cat /tmp/test.el ;; -*- lexical-binding: t; -*- (let ((x 1)) (and (equal (+ x 2) 3))) M-x byte-compile-file RET /tmp/test RET Compiling file /tmp/test.el at Fri Aug 18 02:30:59 2017 test.el:2:1:Warning: value returned from (+ x 2) is unused test.el:2:1:Warning: value returned from (+ x 2) is unused I used (+ x 2) as 1st argument for `equal'. What more should i do to use it? Maybe invite (+ x 2) to the cinema? I hope (+ x 2) will pay, cinema it's too expensive here.