[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24863: Functions declared as side-effect-free do not generate warnin
From: |
Lars Ingebrigtsen |
Subject: |
bug#24863: Functions declared as side-effect-free do not generate warnings in the same file |
Date: |
Sat, 06 Feb 2021 12:54:21 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Wilfred Hughes <me@wilfred.me.uk> writes:
> If I declare a function as side-effect-free, I do not get warnings
> when I call it for side effects:
>
> (defun foo-pure (x)
> (declare (side-effect-free t))
> x)
>
> (defun foo-calls-pure ()
> ;; No warning here:
> (foo-pure 1)
> 12)
>
> However, if I define foo-pure in a standalone file and byte-compile
> it, I get byte-compile warnings when I define foo-calls-pure in a
> second file.
I tried this in Emacs 25.1-28, and I do get a warning:
Compiling file /tmp/side.el at Sat Feb 6 12:51:52 2021
Entering directory ‘/tmp/’
In foo-calls-pure:
side.el:5:8: Warning: value returned from (foo-pure 1) is unused
You didn't specify what Emacs version you were reporting the bug for,
but I'm going to go ahead and guess that this has been fixed since, and
I'm closing this bug report. If the issue persists, please respond to
the debbugs address and we'll reopen.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#24863: Functions declared as side-effect-free do not generate warnings in the same file,
Lars Ingebrigtsen <=