From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 16 16:17:09 2013 Received: (at submit) by debbugs.gnu.org; 16 Jul 2013 20:17:09 +0000 Received: from localhost ([127.0.0.1]:59092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UzBgL-0005LZ-Bo for submit@debbugs.gnu.org; Tue, 16 Jul 2013 16:17:09 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:59726 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UzBgJ-0005LL-5H for submit@debbugs.gnu.org; Tue, 16 Jul 2013 16:17:07 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1UzBgI-0007B7-1o; Tue, 16 Jul 2013 16:17:06 -0400 From: Glenn Morris To: submit@debbugs.gnu.org Subject: warning about unused returned value from some ert shoulds X-Spook: SCUD missile ARPA Bruxelles cryptographic Area 51 X-Ran: Mu|v`ku/7}DXV:|V=4TE7P"gZf9;tO|=RU[=,~LEM&LVt5,-$d\Rnt9CGMi6*R{rA^Zebf X-Hue: red X-Debbugs-No-Ack: yes X-Attribution: GM Date: Tue, 16 Jul 2013 16:17:05 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.4 (-----) Package: emacs Version: 24.3 Severity: minor Compiling a file with contents: ;; -*- lexical-binding: t; -*- (require 'ert) (require 'cl-lib) (defvar foo-test 1) (should foo-test) (cl-assert foo-test) results in a warning (for some reason, only when lexical-binding is t): foo.el:5:1:Warning: value returned from (car value-94600) is unused The warning is from the `should'. Obviously it is a bogus warning because the whole point of the should is to test the return value. The similar cl-assert does not trigger a warning, because internally cl-assert is written differently. This is the same issue as http://debbugs.gnu.org/10969, for what is now cl-pop. byte-optimize-form-code-walker has special handling for the standard `pop' macro so as not to warn about unused return values from (pop foo). It would be nice if there was a general way to get the same result for arbitrary macros (sort of the opposite of side-effect-free?), but I don't see how. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 22 11:34:59 2013 Received: (at 14883) by debbugs.gnu.org; 22 Jul 2013 15:34:59 +0000 Received: from localhost ([127.0.0.1]:42832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V1I8Y-0001bP-Rh for submit@debbugs.gnu.org; Mon, 22 Jul 2013 11:34:59 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:23357) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V1I8W-0001b6-97 for 14883@debbugs.gnu.org; Mon, 22 Jul 2013 11:34:56 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rw7r/2dsb2JhbAA7Cb8OF3OCHgEBBAFWIwULCw4mEhQYDSSIHgbBLY0Wg3QDlymKIIMxgV6DEw X-IPAS-Result: Av4EABK/CFG4rw7r/2dsb2JhbAA7Cb8OF3OCHgEBBAFWIwULCw4mEhQYDSSIHgbBLY0Wg3QDlymKIIMxgV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="19526932" Received: from 184-175-14-235.dsl.teksavvy.com (HELO pastel.home) ([184.175.14.235]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 22 Jul 2013 11:34:44 -0400 Received: by pastel.home (Postfix, from userid 20848) id 0B6986D694; Mon, 22 Jul 2013 11:34:50 -0400 (EDT) From: Stefan Monnier To: Glenn Morris Subject: Re: bug#14883: warning about unused returned value from some ert shoulds Message-ID: References: Date: Mon, 22 Jul 2013 11:34:49 -0400 In-Reply-To: (Glenn Morris's message of "Tue, 16 Jul 2013 16:17:05 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 14883 Cc: 14883@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > This is the same issue as http://debbugs.gnu.org/10969, for what is now > cl-pop. There's no `cl-pop'. Instead `pop' is now always like CL's `pop'. > byte-optimize-form-code-walker has special handling for the standard > `pop' macro so as not to warn about unused return values from (pop foo). > It would be nice if there was a general way to get the same result for > arbitrary macros (sort of the opposite of side-effect-free?), but I > don't see how. I think the way to do it is to introduce a new function (call it `ignorable') which works like `identity' and then make pop use it around the code that returns the value. Then byte-optimize-form-code-walker can be modified to recognize this function and just throw away the whole call when `for-effect' is nil. We can then get rid of this ad-hoc handling of `pop'. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 04 23:06:54 2013 Received: (at 14883-done) by debbugs.gnu.org; 5 Sep 2013 03:06:54 +0000 Received: from localhost ([127.0.0.1]:40944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VHPuH-0008Fk-Mi for submit@debbugs.gnu.org; Wed, 04 Sep 2013 23:06:54 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:20974) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VHPuE-0008FT-VY for 14883-done@debbugs.gnu.org; Wed, 04 Sep 2013 23:06:51 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+KK6/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFHO+KK6/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="26499747" Received: from 206-248-162-186.dsl.teksavvy.com (HELO ceviche.home) ([206.248.162.186]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Sep 2013 23:03:38 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 9DA3F660A1; Wed, 4 Sep 2013 23:06:38 -0400 (EDT) From: Stefan Monnier To: Glenn Morris Subject: Re: bug#14883: warning about unused returned value from some ert shoulds Message-ID: References: Date: Wed, 04 Sep 2013 23:06:38 -0400 In-Reply-To: (Glenn Morris's message of "Tue, 16 Jul 2013 16:17:05 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 14883-done Cc: 14883-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Compiling a file with contents: > ;; -*- lexical-binding: t; -*- > (require 'ert) > (require 'cl-lib) > (defvar foo-test 1) > (should foo-test) > (cl-assert foo-test) > results in a warning (for some reason, only when lexical-binding is t): > foo.el:5:1:Warning: value returned from (car value-94600) is unused This `car' came from the closure conversion. I believe it is now fixed in the trunk. Thank you. Stefan From unknown Tue Jun 24 03:25:25 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 03 Oct 2013 11:24:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator