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 13:08:49 +0300 Message-ID: <83ef5ycnny.fsf@gnu.org> References: <83ftqecrms.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="63297"; mail-complaints-to="usenet@blaine.gmane.org" Cc: phst@google.com, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 19 12:16:14 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 1hHQZ4-000GLS-GT for ged-emacs-devel@m.gmane.org; Fri, 19 Apr 2019 12:16:14 +0200 Original-Received: from localhost ([127.0.0.1]:54271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHQZ3-000250-HN for ged-emacs-devel@m.gmane.org; Fri, 19 Apr 2019 06:16:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHQXr-0001af-Dm for emacs-devel@gnu.org; Fri, 19 Apr 2019 06:15:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHQSC-0006m3-Do; Fri, 19 Apr 2019 06:09:08 -0400 Original-Received: from [176.228.60.248] (port=4549 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hHQSB-00086V-3J; Fri, 19 Apr 2019 06:09:08 -0400 In-reply-to: (message from Philipp Stephani on Fri, 19 Apr 2019 11:52:13 +0200) 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:235651 Archived-At: > From: Philipp Stephani > Date: Fri, 19 Apr 2019 11:52:13 +0200 > Cc: Philipp Stephani , Emacs developers > > Am Fr., 19. Apr. 2019 um 10:43 Uhr schrieb Eli Zaretskii : > > > > 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.