From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 74f54af: Use eassume (false) for branch that's never taken. Date: Fri, 19 Apr 2019 23:14:00 +0300 Message-ID: <83zholbvnb.fsf@gnu.org> References: <83ftqecrms.fsf@gnu.org> <83ef5ycnny.fsf@gnu.org> <9b3a1717-64de-795a-2acf-0698576caf02@cs.ucla.edu> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="76214"; mail-complaints-to="usenet@blaine.gmane.org" Cc: phst@google.com, p.stephani2@gmail.com, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 19 22:14:55 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hHZuR-000Ji0-EZ for ged-emacs-devel@m.gmane.org; Fri, 19 Apr 2019 22:14:55 +0200 Original-Received: from localhost ([127.0.0.1]:60931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHZuQ-0001dl-D5 for ged-emacs-devel@m.gmane.org; Fri, 19 Apr 2019 16:14:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHZtp-0001dV-2j for emacs-devel@gnu.org; Fri, 19 Apr 2019 16:14:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHZto-00019a-KA; Fri, 19 Apr 2019 16:14:16 -0400 Original-Received: from [176.228.60.248] (port=2264 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hHZtn-0004sC-UA; Fri, 19 Apr 2019 16:14:16 -0400 In-reply-to: <9b3a1717-64de-795a-2acf-0698576caf02@cs.ucla.edu> (message from Paul Eggert on Fri, 19 Apr 2019 12:04:51 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235674 Archived-At: > Cc: phst@google.com, emacs-devel@gnu.org > From: Paul Eggert > 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.