emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master 74f54af: Use eassume (false) for branch that's


From: Eli Zaretskii
Subject: Re: [Emacs-diffs] master 74f54af: Use eassume (false) for branch that's never taken.
Date: Fri, 19 Apr 2019 23:14:00 +0300

> Cc: address@hidden, address@hidden
> From: Paul Eggert <address@hidden>
> 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.



reply via email to

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