From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#51484: [PATCH] Move runtime check for recent giflib to compile time Date: Fri, 29 Oct 2021 19:10:30 +0300 Message-ID: <835ytfrevd.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6820"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51484@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 29 18:19:38 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgUbS-0001al-5b for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Oct 2021 18:19:38 +0200 Original-Received: from localhost ([::1]:37550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgUbR-0000lv-1p for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Oct 2021 12:19:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgUT8-00082n-FS for bug-gnu-emacs@gnu.org; Fri, 29 Oct 2021 12:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgUT8-0004kp-6o for bug-gnu-emacs@gnu.org; Fri, 29 Oct 2021 12:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgUT7-0000CQ-Qe for bug-gnu-emacs@gnu.org; Fri, 29 Oct 2021 12:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Oct 2021 16:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51484 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51484-submit@debbugs.gnu.org id=B51484.1635523854751 (code B ref 51484); Fri, 29 Oct 2021 16:11:01 +0000 Original-Received: (at 51484) by debbugs.gnu.org; 29 Oct 2021 16:10:54 +0000 Original-Received: from localhost ([127.0.0.1]:55681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgUT0-0000C3-Et for submit@debbugs.gnu.org; Fri, 29 Oct 2021 12:10:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgUSx-0000Bo-Bc for 51484@debbugs.gnu.org; Fri, 29 Oct 2021 12:10:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgUSr-0004cr-UD; Fri, 29 Oct 2021 12:10:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=B4Q7WQU9NIOzb0u+5SzggABVeAyNwZF+3etH1gxyi2U=; b=WBGBbJ1OnpcI 1NM8cNY6mZ+iHb/DcuVm4Q8vzO9iqcr5bacsPPws29i2Pd2nctVV3kwyvLE654kiHBX6vfRKrHF3R x66YTyrWxTP9CCzvi5G+XHPWTbYkPml0Tm+kqv4WP80LPRZC2hxn1kTVG7bHKmVjSQnv8Pz2RjVd+ DxUFHgiPSlAxdkFwn0XQ2gAx6OLDh2uHKCLKn5B0broHeGbb8NVqC3RfIT1lavQfM8/qqzGvs32Ul c/TlMPp5yAXeVmsdTxhWtSOjAr2Kr1tdX2UQ135A2mrdNr1FjC/Fx/chBjFlguyH7Pi5Oi/KRRiUI Msxfr3qnFCs+wi8pQRTlKw==; Original-Received: from [87.69.77.57] (port=4693 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgUSq-00027L-M5; Fri, 29 Oct 2021 12:10:45 -0400 In-Reply-To: (message from Stefan Kangas on Fri, 29 Oct 2021 07:42:56 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218568 Archived-At: > From: Stefan Kangas > Date: Fri, 29 Oct 2021 07:42:56 -0700 > > I'm looking into some bugs in how we handle gifs, and I see that we > check for GIFLIB_MAJOR at runtime. Only once, right? > Is there any reason not to do it at compile-time as in the attached > patch? (What patch?) The compiler converts that into a run-time constant anyway. The reason for using such "run-time" testing is usually to have a more readable code, since #ifdef's make the code harder to read. There are no downsides, since the test is compiled away. > I expect that GCC is smart enough to see that "5 < 4" is always false > and optimize this all away, and probably also won't include unused > static variables, so maybe this doesn't matter. But I think it's nice > to be a bit more explicit, and I guess it can't hurt to see warnings if > anyone tries using interlace_start and interlace_increment outside of > their intended use. I don't think I understand what scenario you have in mind where having an #ifdef would be better. Please elaborate.