From unknown Sun Jun 22 00:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51484: [PATCH] Move runtime check for recent giflib to compile time Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Oct 2021 14:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51484 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 51484@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163551858430638 (code B ref -1); Fri, 29 Oct 2021 14:44:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Oct 2021 14:43:04 +0000 Received: from localhost ([127.0.0.1]:55575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgT60-0007y6-EI for submit@debbugs.gnu.org; Fri, 29 Oct 2021 10:43:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:43404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgT5w-0007xe-GP for submit@debbugs.gnu.org; Fri, 29 Oct 2021 10:43:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgT5w-0006OB-8g for bug-gnu-emacs@gnu.org; Fri, 29 Oct 2021 10:43:00 -0400 Received: from mail-pj1-f50.google.com ([209.85.216.50]:34394) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgT5u-0007Hy-IE for bug-gnu-emacs@gnu.org; Fri, 29 Oct 2021 10:42:59 -0400 Received: by mail-pj1-f50.google.com with SMTP id q2-20020a17090a2e0200b001a0fd4efd49so7468962pjd.1 for ; Fri, 29 Oct 2021 07:42:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=cOmTNibscrlv1SnTQ8EloMsLDN4e0zTAIr72V1RtiLI=; b=xS0hAP/QPu5TaQ/oQ9yH90C2XHeafv/y63xqMZ1WptrIj9ruERp4rPndjTcH5JRmxv yQkW9c/4KBD5pQ0sOD4e8Cf61vFL8rE6umxy0R9WW3KxeN21w/ZxNiwz1+M2Bmamf4q5 MIWiAkk53ArjgGqAPr3T1dqfKve8r033PS8gNUdUfdFMUXr1gaS1cuU+uWkiDDDRiWOy sxsfy9Y0RkRxb0D/Bckg9lb3ycl3pCFokuAPHYstQ5rbWiYQxYxVfros9/gyqeOq9i2v TTd/t74qqYoXCy2vM58SOvjZI2yPYKRXVp94caGJiuhylobfhSuhWgU/fcZQSEyXqwgB SfXQ== X-Gm-Message-State: AOAM533+RpoAokLHa58XnTFOwOvkswYk6EHzwkEdqpAlEKMluHnngoPc T4EXQgd6/8IWl24P+VaAuK9H2p4lgQsjKeAaIuzPZ3+U X-Google-Smtp-Source: ABdhPJx0wO8+Mg6Bo3mcl8yCihSpph0s7xXOSOQfbxgbbjau8v12jRw2hbDEnlAO12iYoGh1b7nfNmUqlkU15Nq1LJI= X-Received: by 2002:a17:902:a410:b0:141:be1a:53d1 with SMTP id p16-20020a170902a41000b00141be1a53d1mr204481plq.71.1635518576814; Fri, 29 Oct 2021 07:42:56 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 29 Oct 2021 07:42:56 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Fri, 29 Oct 2021 07:42:56 -0700 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=209.85.216.50; envelope-from=stefankangas@gmail.com; helo=mail-pj1-f50.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) Severity: wishlist I'm looking into some bugs in how we handle gifs, and I see that we check for GIFLIB_MAJOR at runtime. Is there any reason not to do it at compile-time as in the attached patch? 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. From unknown Sun Jun 22 00:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51484: [PATCH] Move runtime check for recent giflib to compile time Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Oct 2021 16:03: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 To: Stefan Kangas Cc: 51484@debbugs.gnu.org Received: via spool by 51484-submit@debbugs.gnu.org id=B51484.163552332932284 (code B ref 51484); Fri, 29 Oct 2021 16:03:01 +0000 Received: (at 51484) by debbugs.gnu.org; 29 Oct 2021 16:02:09 +0000 Received: from localhost ([127.0.0.1]:55675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgUKX-0008Od-D2 for submit@debbugs.gnu.org; Fri, 29 Oct 2021 12:02:09 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgUKR-0008O0-GD for 51484@debbugs.gnu.org; Fri, 29 Oct 2021 12:02:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4Sqm2b1g7j8YIrlqDeqfLHHGjMAJEoG4gAQwpY0wl2E=; b=mSpP2gD9KAGu+k/AHUpE78l+iu mphCPO+tCy3skO51QKcVhYGNKFLKdFdg4PWDCveay5ySQFG1LSLKqIBX8zX9ehuQXP+WSH9ZFA7Rr odvV0FH1tDaR3kp2SEcuzXvAnCV+gfPxWbmffTgPNPW1qL4m0TuaunYe8Cl8BOlJfgew=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgUKI-0001DI-TH; Fri, 29 Oct 2021 18:01:57 +0200 From: Lars Ingebrigtsen References: Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAAAXNSR0IArs4c6QAAAAlQTFRF IB0euqGL////HT05FwAAAAFiS0dEAmYLfGQAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfl Ch0PORh0KuWjAAAAM0lEQVQoz2NgGMlAACdHBJnDglOGRiAA2R4RsNugXFGQFKsDhMMYCgQhMHUg Hh3cRhkAAC63BDwjw/d4AAAAWmVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABK ARsABQAAAAEAAABSASgAAwAAAAEAAgAAAhMAAwAAAAEAAQAAAAAAAAAAAEgAAAABAAAASAAAAAEf Uvc0AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTEwLTI5VDE1OjU3OjI0KzAwOjAw0lVhXQAAACV0 RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMC0yOVQxNTo1NzoyNCswMDowMKMI2eEAAAAXdEVYdGV4aWY6 WUNiQ3JQb3NpdGlvbmluZwAxrA+AYwAAADh0RVh0aWNjOmNvcHlyaWdodABDb3B5cmlnaHQgKGMp IDE5OTggSGV3bGV0dC1QYWNrYXJkIENvbXBhbnn5V3k3AAAAIXRFWHRpY2M6ZGVzY3JpcHRpb24A c1JHQiBJRUM2MTk2Ni0yLjFXrdpHAAAAJnRFWHRpY2M6bWFudWZhY3R1cmVyAElFQyBodHRwOi8v d3d3LmllYy5jaBx/AEwAAAA3dEVYdGljYzptb2RlbABJRUMgNjE5NjYtMi4xIERlZmF1bHQgUkdC IGNvbG91ciBzcGFjZSAtIHNSR0JEU0ipAAAAAElFTkSuQmCC X-Now-Playing: Moor Mother's _Black Encyclopedia of the Air_: "Made A Circle (feat. Nappy Nina, Maassai, Antonia Gabriela & Orion Sun)" Date: Fri, 29 Oct 2021 18:01:54 +0200 In-Reply-To: (Stefan Kangas's message of "Fri, 29 Oct 2021 07:42:56 -0700") Message-ID: <87ee83x1jh.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Kangas writes: > I'm looking into some bugs in how we handle gifs, and I see that we > check for GIFLIB_MAJOR at runtime. Is there any reason not to do it at > compile-time as in the attached patch? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Kangas writes: > I'm looking into some bugs in how we handle gifs, and I see that we > check for GIFLIB_MAJOR at runtime. Is there any reason not to do it at > compile-time as in the attached patch? -ENOPATCH -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Jun 22 00:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51484: [PATCH] Move runtime check for recent giflib to compile time 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 To: Stefan Kangas Cc: 51484@debbugs.gnu.org Received: via spool by 51484-submit@debbugs.gnu.org id=B51484.1635523854751 (code B ref 51484); Fri, 29 Oct 2021 16:11:01 +0000 Received: (at 51484) by debbugs.gnu.org; 29 Oct 2021 16:10:54 +0000 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 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 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==; 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 Date: Fri, 29 Oct 2021 19:10:30 +0300 Message-Id: <835ytfrevd.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Kangas on Fri, 29 Oct 2021 07:42:56 -0700) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From unknown Sun Jun 22 00:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51484: [PATCH] Move runtime check for recent giflib to compile time Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Oct 2021 16:31:02 +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 To: Eli Zaretskii Cc: 51484@debbugs.gnu.org Received: via spool by 51484-submit@debbugs.gnu.org id=B51484.16355250513038 (code B ref 51484); Fri, 29 Oct 2021 16:31:02 +0000 Received: (at 51484) by debbugs.gnu.org; 29 Oct 2021 16:30:51 +0000 Received: from localhost ([127.0.0.1]:55708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgUmJ-0000mv-1u for submit@debbugs.gnu.org; Fri, 29 Oct 2021 12:30:51 -0400 Received: from mail-pg1-f180.google.com ([209.85.215.180]:38650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgUmF-0000me-Gb for 51484@debbugs.gnu.org; Fri, 29 Oct 2021 12:30:49 -0400 Received: by mail-pg1-f180.google.com with SMTP id e65so10389053pgc.5 for <51484@debbugs.gnu.org>; Fri, 29 Oct 2021 09:30:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=G1GtExnEtSn7P6ytsH2hW4KhuetBarKGbv4hYYKl/W4=; b=D3ZVorl9i1s/JJ7upC9PZmdKB+9U++073JWANJZqbE2I/sVlovFc+CJ7vpSF4dK8tv Ke6FZGZ+qtCFxt0sGVxZNHcdr7/EQB6XOg+HdJ4puMDKkfULwROXHfFKg9+vi9gpHE4n yN9U44OQcSHPwA22lp/AobU/3bvo8GniWJzeo+5/1oitxFSvSPguUQHfTpTC2RA2Ourw S55QwjRKEX2+pGqFuB4nNdK29V2pMxh32ayeRNAiOuKcCA1M+ls/H0mxn7WKHYqhjr99 vX85yFt/WoEc0vJXTak4TZcpUqtBjh8UrCDjuBSkwMhOWIIerbIs4MWf21Og4Qt+A+Mc J30Q== X-Gm-Message-State: AOAM5337DG8cntx5ZBofePAdX6a08b7x3evy2hrgXvBij4C+CCbjVF6+ LUedE3mwnd8J4ibhl+L9FyB9vi0IL6N8k62ZwOI= X-Google-Smtp-Source: ABdhPJxMBB0d1yX72kIjpT+3vI+9CNY5UmS7Io8UTelR5goXcks0mDv/kqHsRh9MTd7+NMl7Jr10Uml3myFuGnbOO4I= X-Received: by 2002:a05:6a00:244d:b0:44d:c279:5155 with SMTP id d13-20020a056a00244d00b0044dc2795155mr11840990pfj.0.1635525041768; Fri, 29 Oct 2021 09:30:41 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 29 Oct 2021 09:30:40 -0700 From: Stefan Kangas In-Reply-To: <835ytfrevd.fsf@gnu.org> References: <835ytfrevd.fsf@gnu.org> MIME-Version: 1.0 Date: Fri, 29 Oct 2021 09:30:40 -0700 Message-ID: Content-Type: multipart/mixed; boundary="00000000000022f13f05cf80597f" X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --00000000000022f13f05cf80597f Content-Type: text/plain; charset="UTF-8" Eli Zaretskii writes: > (What patch?) Oops, let's try that again. > 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. Right, hence my asking what you all think of the patch. Which is now hopefully also attached. --00000000000022f13f05cf80597f Content-Type: text/x-diff; charset="US-ASCII"; name="0001-Move-runtime-check-for-recent-giflib-to-compile-time.patch" Content-Disposition: attachment; filename="0001-Move-runtime-check-for-recent-giflib-to-compile-time.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: fe3ac303bbc902c5_0.1 RnJvbSBlZTk3NWVlNmIyYzk0OTZjNDljZmIzNmFhMjJhY2FiOWNlY2EyZDMyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5AbWFyeGlzdC5zZT4KRGF0 ZTogRnJpLCAyOSBPY3QgMjAyMSAxNToyNDoyNiArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIE1vdmUg cnVudGltZSBjaGVjayBmb3IgcmVjZW50IGdpZmxpYiB0byBjb21waWxlIHRpbWUKCiogc3JjL2lt YWdlLmMKKGludGVybGFjZV9zdGFydCwgaW50ZXJsYWNlX2luY3JlbWVudCkgW0dJRkxJQl9NQUpP UiA8IDVdOgpEb24ndCBkZWZpbmUgd2hlbiB1c2luZyByZWNlbnQgZ2lmbGliLgooZ2lmX2xvYWQp OiBSZXBsYWNlIHJ1bnRpbWUgY2hlY2sgZm9yICJHSUZMSUJfTUFKT1IgPCA1IiB3aXRoCnByZXBy b2Nlc3NvciBkaXJlY3RpdmUuCi0tLQogc3JjL2ltYWdlLmMgfCA4ICsrKysrKystCiAxIGZpbGUg Y2hhbmdlZCwgNyBpbnNlcnRpb25zKCspLCAxIGRlbGV0aW9uKC0pCgpkaWZmIC0tZ2l0IGEvc3Jj L2ltYWdlLmMgYi9zcmMvaW1hZ2UuYwppbmRleCA5OTUzM2JiZDFiLi4wZjEwNTEzMWFhIDEwMDY0 NAotLS0gYS9zcmMvaW1hZ2UuYworKysgYi9zcmMvaW1hZ2UuYwpAQCAtODM1OCw4ICs4MzU4LDEw IEBAIGdpZl9jbG9zZSAoR2lmRmlsZVR5cGUgKmdpZiwgaW50ICplcnIpCiAvKiBMb2FkIEdJRiBp bWFnZSBJTUcgZm9yIHVzZSBvbiBmcmFtZSBGLiAgVmFsdWUgaXMgdHJ1ZSBpZgogICAgc3VjY2Vz c2Z1bC4gICovCiAKKyNpZiBHSUZMSUJfTUFKT1IgPCA1CiBzdGF0aWMgY29uc3QgaW50IGludGVy bGFjZV9zdGFydFtdID0gezAsIDQsIDIsIDF9Owogc3RhdGljIGNvbnN0IGludCBpbnRlcmxhY2Vf aW5jcmVtZW50W10gPSB7OCwgOCwgNCwgMn07CisjZW5kaWYKIAogI2RlZmluZSBHSUZfTE9DQUxf REVTQ1JJUFRPUl9FWFRFTlNJT04gMjQ5CiAKQEAgLTg2MjYsNyArODYyOCw4IEBAIGdpZl9sb2Fk IChzdHJ1Y3QgZnJhbWUgKmYsIHN0cnVjdCBpbWFnZSAqaW1nKQogCSAgfQogCiAgICAgICAvKiBB cHBseSB0aGUgcGl4ZWwgdmFsdWVzLiAgKi8KLSAgICAgIGlmIChHSUZMSUJfTUFKT1IgPCA1ICYm IGdpZi0+U2F2ZWRJbWFnZXNbal0uSW1hZ2VEZXNjLkludGVybGFjZSkKKyNpZiBHSUZMSUJfTUFK T1IgPCA1CisgICAgICBpZiAoZ2lmLT5TYXZlZEltYWdlc1tqXS5JbWFnZURlc2MuSW50ZXJsYWNl KQogCXsKIAkgIGludCByb3csIHBhc3M7CiAKQEAgLTg2NTAsNiArODY1Myw3IEBAIGdpZl9sb2Fk IChzdHJ1Y3QgZnJhbWUgKmYsIHN0cnVjdCBpbWFnZSAqaW1nKQogCX0KICAgICAgIGVsc2UKIAl7 CisjZW5kaWYKICAgICAgICAgICBmb3IgKHkgPSAwOyB5IDwgc3ViaW1nX2hlaWdodDsgKyt5KQog CSAgICBmb3IgKHggPSAwOyB4IDwgc3ViaW1nX3dpZHRoOyArK3gpCiAJICAgICAgewpAQCAtODY2 MSw3ICs4NjY1LDkgQEAgZ2lmX2xvYWQgKHN0cnVjdCBmcmFtZSAqZiwgc3RydWN0IGltYWdlICpp bWcpCiAgICAgICAgICAgICAgICAgICB9CiAJICAgICAgfQogCX0KKyNpZiBHSUZMSUJfTUFKT1Ig PCA1CiAgICAgfQorI2VuZGlmCiAKICNpZmRlZiBDT0xPUl9UQUJMRV9TVVBQT1JUCiAgIGltZy0+ Y29sb3JzID0gY29sb3JzX2luX2NvbG9yX3RhYmxlICgmaW1nLT5uY29sb3JzKTsKLS0gCjIuMzAu MgoK --00000000000022f13f05cf80597f-- From unknown Sun Jun 22 00:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#51484: [PATCH] Move runtime check for recent giflib to compile time Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Oct 2021 17:59:02 +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 To: Stefan Kangas Cc: 51484@debbugs.gnu.org Received: via spool by 51484-submit@debbugs.gnu.org id=B51484.163553029422416 (code B ref 51484); Fri, 29 Oct 2021 17:59:02 +0000 Received: (at 51484) by debbugs.gnu.org; 29 Oct 2021 17:58:14 +0000 Received: from localhost ([127.0.0.1]:55834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgW8s-0005pU-Gj for submit@debbugs.gnu.org; Fri, 29 Oct 2021 13:58:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgW8p-0005pB-Ki for 51484@debbugs.gnu.org; Fri, 29 Oct 2021 13:58:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgW8k-0008Um-6l; Fri, 29 Oct 2021 13:58:06 -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=6EIUyXhAIalwUmaE3/OFMIRbpHywi1gHBfa/7yaUDqA=; b=AOpwSMoDC4FX /avhsXjugEfJUpnF3mX1DE4CNwQT0f4twE3eUD97dbDCs+4j5/H1KjEn4ZdRf2BsmrRd+Em5d7MMT atNq5IoWX8pugC8vCLq9TmXFTUTTZ8Gk5jJdq6Kbxar340VHwFFJAQ1D2hKt4ZxuSJD4uXSHTsC3M Mgu5wy8pNtLED9nwwD2CNEAl4Dks546Iq5aj+gTzRA4lzaEDrvLW/Sr7N97QG9hUPQyV7yOsAlESn B6foyfj+H5C0GXwDEeSnzqVQvGzaQt/zyAehvozu6dQ3c6h9pURXDr7GLfqVJcFiBIQH1w9eaEfS1 KIAYOUEZt0ZaKSkD7z5jrw==; Received: from [87.69.77.57] (port=3293 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 1mgW8j-0008UY-NQ; Fri, 29 Oct 2021 13:58:06 -0400 Date: Fri, 29 Oct 2021 20:57:52 +0300 Message-Id: <83y26bpvc0.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Stefan Kangas on Fri, 29 Oct 2021 09:30:40 -0700) References: <835ytfrevd.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Kangas > Date: Fri, 29 Oct 2021 09:30:40 -0700 > Cc: 51484@debbugs.gnu.org > > > 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. > > Right, hence my asking what you all think of the patch. Which is now > hopefully also attached. I generally prefer to avoid #ifdef's, so I think the change you propose is not for the better. We have similar code elsewhere in Emacs, and there's nothing wrong with it. From unknown Sun Jun 22 00:54:20 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Stefan Kangas Subject: bug#51484: closed (Re: bug#51484: [PATCH] Move runtime check for recent giflib to compile time) Message-ID: References: X-Gnu-PR-Message: they-closed 51484 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 51484@debbugs.gnu.org Date: Fri, 29 Oct 2021 18:16:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1635531362-24615-1" This is a multi-part message in MIME format... ------------=_1635531362-24615-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #51484: [PATCH] Move runtime check for recent giflib to compile time which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 51484@debbugs.gnu.org. --=20 51484: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D51484 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1635531362-24615-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 51484-done) by debbugs.gnu.org; 29 Oct 2021 18:15:12 +0000 Received: from localhost ([127.0.0.1]:55868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgWPH-0006Ne-Nm for submit@debbugs.gnu.org; Fri, 29 Oct 2021 14:15:11 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:42619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgWPG-0006NK-Bg for 51484-done@debbugs.gnu.org; Fri, 29 Oct 2021 14:15:10 -0400 Received: by mail-pj1-f54.google.com with SMTP id nn3-20020a17090b38c300b001a03bb6c4ebso7942478pjb.1 for <51484-done@debbugs.gnu.org>; Fri, 29 Oct 2021 11:15:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=6qhFjYk41/sGyZT2eAgF5fBSsEAUEQ3kzmOGwpi+EhE=; b=w4yImZ42iXtjnJDEaTe+JkCeCmyNbAtFWHJf7ZSsa6lX5GGgnFN7QW2y2PlA1pJ79+ XvO93t2g8nyO3X3EZyf4AeryiFObGbcUc1+vx0mSsQ6s5HLCNqANZNyWwWBwoebQyj3H yoc1trZ7dhCOdWN3c2Nj6e8FvXZ9gwIxrttvjAaxRc+g2XL+vUbuXYsjTjAJYzY0YoS9 HOQcf8d7B1GiCs1dx+gRaKq0AYQD77NBoMFDtkAf5gfqq91nbNUI/mOHkW7iofgaFjsZ IuG6aPXGuabMRWjGa6nUiKXOGOM7102gjsa/VI0TbhkGgcbG9MGRHj2M4aDZES0qNnfs Zg+w== X-Gm-Message-State: AOAM5331j/L6Uq7KaEEn48E1CHjb1cTJyOaBVsIVRx3n6nNY8j3zkdOy 5idD6JpNIwea1/DL5Fq+2e19cLmD4qIu01sa6iU= X-Google-Smtp-Source: ABdhPJyBCOaiI3OYQ4+smFXvveUf1mbuS2G+wE/LwKDiIootfXzs5MTr8KwYffqJ1QDxfc3jCuqyv8nJkV6ESxJx8Sc= X-Received: by 2002:a17:90b:17d2:: with SMTP id me18mr21414667pjb.132.1635531304580; Fri, 29 Oct 2021 11:15:04 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 29 Oct 2021 11:15:04 -0700 From: Stefan Kangas In-Reply-To: <83y26bpvc0.fsf@gnu.org> References: <835ytfrevd.fsf@gnu.org> <83y26bpvc0.fsf@gnu.org> MIME-Version: 1.0 Date: Fri, 29 Oct 2021 11:15:04 -0700 Message-ID: Subject: Re: bug#51484: [PATCH] Move runtime check for recent giflib to compile time To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 51484-done Cc: 51484-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Eli Zaretskii writes: > I generally prefer to avoid #ifdef's, so I think the change you > propose is not for the better. We have similar code elsewhere in > Emacs, and there's nothing wrong with it. OK, thanks for taking a look. I appreciate you taking the time to explain your thinking as well, it is most helpful. I'm closing this bug report. ------------=_1635531362-24615-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 Oct 2021 14:43:04 +0000 Received: from localhost ([127.0.0.1]:55575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgT60-0007y6-EI for submit@debbugs.gnu.org; Fri, 29 Oct 2021 10:43:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:43404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgT5w-0007xe-GP for submit@debbugs.gnu.org; Fri, 29 Oct 2021 10:43:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgT5w-0006OB-8g for bug-gnu-emacs@gnu.org; Fri, 29 Oct 2021 10:43:00 -0400 Received: from mail-pj1-f50.google.com ([209.85.216.50]:34394) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgT5u-0007Hy-IE for bug-gnu-emacs@gnu.org; Fri, 29 Oct 2021 10:42:59 -0400 Received: by mail-pj1-f50.google.com with SMTP id q2-20020a17090a2e0200b001a0fd4efd49so7468962pjd.1 for ; Fri, 29 Oct 2021 07:42:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=cOmTNibscrlv1SnTQ8EloMsLDN4e0zTAIr72V1RtiLI=; b=xS0hAP/QPu5TaQ/oQ9yH90C2XHeafv/y63xqMZ1WptrIj9ruERp4rPndjTcH5JRmxv yQkW9c/4KBD5pQ0sOD4e8Cf61vFL8rE6umxy0R9WW3KxeN21w/ZxNiwz1+M2Bmamf4q5 MIWiAkk53ArjgGqAPr3T1dqfKve8r033PS8gNUdUfdFMUXr1gaS1cuU+uWkiDDDRiWOy sxsfy9Y0RkRxb0D/Bckg9lb3ycl3pCFokuAPHYstQ5rbWiYQxYxVfros9/gyqeOq9i2v TTd/t74qqYoXCy2vM58SOvjZI2yPYKRXVp94caGJiuhylobfhSuhWgU/fcZQSEyXqwgB SfXQ== X-Gm-Message-State: AOAM533+RpoAokLHa58XnTFOwOvkswYk6EHzwkEdqpAlEKMluHnngoPc T4EXQgd6/8IWl24P+VaAuK9H2p4lgQsjKeAaIuzPZ3+U X-Google-Smtp-Source: ABdhPJx0wO8+Mg6Bo3mcl8yCihSpph0s7xXOSOQfbxgbbjau8v12jRw2hbDEnlAO12iYoGh1b7nfNmUqlkU15Nq1LJI= X-Received: by 2002:a17:902:a410:b0:141:be1a:53d1 with SMTP id p16-20020a170902a41000b00141be1a53d1mr204481plq.71.1635518576814; Fri, 29 Oct 2021 07:42:56 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 29 Oct 2021 07:42:56 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Fri, 29 Oct 2021 07:42:56 -0700 Message-ID: Subject: [PATCH] Move runtime check for recent giflib to compile time To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=209.85.216.50; envelope-from=stefankangas@gmail.com; helo=mail-pj1-f50.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) Severity: wishlist I'm looking into some bugs in how we handle gifs, and I see that we check for GIFLIB_MAJOR at runtime. Is there any reason not to do it at compile-time as in the attached patch? 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. ------------=_1635531362-24615-1--