From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18014: 24.3; Unused Lexical argument warning, when argument is used in a function... Date: Tue, 15 Jul 2014 17:18:53 +0300 Message-ID: <83iomy9036.fsf@gnu.org> References: <83tx6k80aj.fsf@gnu.org> <83oaws7yaq.fsf@gnu.org> <83lhrv9an4.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1405433971 32030 80.91.229.3 (15 Jul 2014 14:19:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Jul 2014 14:19:31 +0000 (UTC) Cc: 18014@debbugs.gnu.org To: Matthew Fidler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 15 16:19:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X73Zg-0004Nx-OK for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jul 2014 16:19:20 +0200 Original-Received: from localhost ([::1]:34914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X73Zg-0000fK-95 for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Jul 2014 10:19:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X73ZW-0000S6-1k for bug-gnu-emacs@gnu.org; Tue, 15 Jul 2014 10:19:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X73ZP-0004TJ-7R for bug-gnu-emacs@gnu.org; Tue, 15 Jul 2014 10:19:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X73ZP-0004Sz-45 for bug-gnu-emacs@gnu.org; Tue, 15 Jul 2014 10:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X73ZO-0003KE-Gn for bug-gnu-emacs@gnu.org; Tue, 15 Jul 2014 10:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Jul 2014 14:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18014 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18014-submit@debbugs.gnu.org id=B18014.140543393612769 (code B ref 18014); Tue, 15 Jul 2014 14:19:02 +0000 Original-Received: (at 18014) by debbugs.gnu.org; 15 Jul 2014 14:18:56 +0000 Original-Received: from localhost ([127.0.0.1]:55720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X73ZE-0003Jo-6R for submit@debbugs.gnu.org; Tue, 15 Jul 2014 10:18:56 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:64887) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X73Z8-0003JS-6j for 18014@debbugs.gnu.org; Tue, 15 Jul 2014 10:18:50 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0N8R00L00BIPR800@a-mtaout23.012.net.il> for 18014@debbugs.gnu.org; Tue, 15 Jul 2014 17:18:39 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8R00LALBR2MS90@a-mtaout23.012.net.il>; Tue, 15 Jul 2014 17:18:39 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91560 Archived-At: > Date: Mon, 14 Jul 2014 14:46:04 -0500 > From: Matthew Fidler > Cc: 18014@debbugs.gnu.org > > Easy enough. Put these in a directory, say ~/emacs-bug-1801 and run the > following command: > > emacs -Q --batch -L . --eval \ > "(progn \ > (setq byte-compile-error-on-warn t) \ > (batch-byte-compile))" *.el > > > On Emacs 24.3 the following warning will occur: > > In toplevel form: > bug.el:10:1:Warning: Unused lexical argument `key' *<<--- Incorrect; key is > a used lexical argument* The line number in this warning is a lie: the problem is in the lambda function: (lambda(key plist) (setq ret (ergoemacs-translation-install plist orig-key ret))) which does leave its 'key' argument unused. (If you rename this argument to something else, leaving the rest of ergoemacs-translate with the original 'key', the warning will reference the new name.) > Also on emacs 24.3, even though batch-byte-compile-error-on-warn is set to > t, it will ignore the errors, which is not what I expect when I set this > option. > On Emacs trunk (24.4) it will not ignore the error but cause the make to > fail. The last observation doesn't match what I see here: when I compile bug.el with the current trunk, Emacs issues the warning, not error, message, and exits with exit code of zero. Which matches what I see in the code: the warning about unused lexical argument is issued (in cconv.el) by calling byte-compile-log-warning, which bypasses the machinery that converts byte-compile warnings to errors; not sure if this is on purpose or not. So if you see something different, there's some other factor(s) at work here. In any case, this is a separate issue, which probably warrants a separate report.