From: Eli Zaretskii <eliz@gnu.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: phst@google.com, emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 74f54af: Use eassume (false) for branch that's never taken.
Date: Fri, 19 Apr 2019 13:08:49 +0300 [thread overview]
Message-ID: <83ef5ycnny.fsf@gnu.org> (raw)
In-Reply-To: <CAArVCkS7kr8Yhbrx_4vd9QphpsY1MZ6L9-nz76NqecF4uUaubg@mail.gmail.com> (message from Philipp Stephani on Fri, 19 Apr 2019 11:52:13 +0200)
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Fri, 19 Apr 2019 11:52:13 +0200
> Cc: Philipp Stephani <phst@google.com>, Emacs developers <emacs-devel@gnu.org>
>
> Am Fr., 19. Apr. 2019 um 10:43 Uhr schrieb Eli Zaretskii <eliz@gnu.org>:
> >
> > Philipp, I don't understand this change. The function in question
> > should return a Lisp_Object, and AFAIU eassume doesn't do that when
> > ENABLE_CHECKING is not defined. What am I missing?
> >
>
> The default branch can never be taken. We use eassume(false) in many
> other places to document this.
AFAICT, all those places don't need to return anything, which is
unlike here.
When ENABLE_CHECKING is not defined, which happens in every production
build, eassume expands to code that has no side effects, so the
function will return a random value to its caller. I don't think this
is desired. If you want to make sure this branch is never taken even
in a production build, simply call emacs_abort there.
next prev parent reply other threads:[~2019-04-19 10:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-19 8:43 [Emacs-diffs] master 74f54af: Use eassume (false) for branch that's never taken Eli Zaretskii
2019-04-19 9:52 ` Philipp Stephani
2019-04-19 10:08 ` Eli Zaretskii [this message]
2019-04-19 19:04 ` Paul Eggert
2019-04-19 19:14 ` Philipp Stephani
2019-04-19 20:16 ` Eli Zaretskii
2019-04-19 20:14 ` Eli Zaretskii
2019-04-19 23:00 ` Paul Eggert
2019-04-20 6:25 ` Eli Zaretskii
2019-04-23 0:52 ` Paul Eggert
2019-04-23 6:19 ` Eli Zaretskii
2019-04-23 16:56 ` Paul Eggert
2019-04-23 17:19 ` Eli Zaretskii
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=83ef5ycnny.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=p.stephani2@gmail.com \
--cc=phst@google.com \
/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.