From: Lars Ingebrigtsen <larsi@gnus.org>
To: Wilfred Hughes <me@wilfred.me.uk>
Cc: 24863@debbugs.gnu.org
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 [thread overview]
Message-ID: <87y2g1bedu.fsf@gnus.org> (raw)
In-Reply-To: <CAFXAjY4YAT_uhdSRc-LCv4ih=LEeHkRA7YEVAV-foh+d-HDmJA@mail.gmail.com> (Wilfred Hughes's message of "Wed, 2 Nov 2016 20:59:39 -0400")
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 parent reply other threads:[~2021-02-06 11:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 0:59 bug#24863: Functions declared as side-effect-free do not generate warnings in the same file Wilfred Hughes
2016-11-03 23:14 ` npostavs
2021-02-06 11:54 ` Lars Ingebrigtsen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y2g1bedu.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=24863@debbugs.gnu.org \
--cc=me@wilfred.me.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.