emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#14883: closed (warning about unused returned value


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#14883: closed (warning about unused returned value from some ert shoulds)
Date: Thu, 05 Sep 2013 03:07:02 +0000

Your message dated Wed, 04 Sep 2013 23:06:38 -0400
with message-id <address@hidden>
and subject line Re: bug#14883: warning about unused returned value from some 
ert shoulds
has caused the debbugs.gnu.org bug report #14883,
regarding warning about unused returned value from some ert shoulds
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
14883: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14883
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: warning about unused returned value from some ert shoulds Date: Tue, 16 Jul 2013 16:17:05 -0400 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
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.



--- End Message ---
--- Begin Message --- Subject: Re: bug#14883: warning about unused returned value from some ert shoulds Date: Wed, 04 Sep 2013 23:06:38 -0400 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
> 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


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]