From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: phst@google.com, p.stephani2@gmail.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 23:14:00 +0300 [thread overview]
Message-ID: <83zholbvnb.fsf@gnu.org> (raw)
In-Reply-To: <9b3a1717-64de-795a-2acf-0698576caf02@cs.ucla.edu> (message from Paul Eggert on Fri, 19 Apr 2019 12:04:51 -0700)
> Cc: phst@google.com, emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Fri, 19 Apr 2019 12:04:51 -0700
>
> On 4/19/19 3:08 AM, Eli Zaretskii wrote:
> > 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.
>
> It looks OK to me. The default branch is impossible, so the function
> cannot return a random value to its caller.
But what bothers me is what happens when the "impossible" becomes
possible, i.e. if the value is neither of the two handled explicitly.
This is what the 'default' branch is for, no? When this happens in
the production build, the function should still return some
predictable value to the caller.
Otherwise, why have the default branch at all?
> this sort of bikeshedding
Thanks a lot! A great incentive to trying to keep our sources clean.
next prev parent reply other threads:[~2019-04-19 20:14 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
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 [this message]
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=83zholbvnb.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=eggert@cs.ucla.edu \
--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.