From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.emacs.devel Subject: Re: Emacs build fails on Windows mingw64 Date: Sun, 24 Oct 2021 13:05:32 -0400 Message-ID: <349dbe47-58a7-cc27-5dd5-408168820aeb@cs.ucla.edu> References: <86v91nfp6e.fsf@gmail.com> <0b467abe-dd50-6a0a-7d1f-37eb990900be@cs.ucla.edu> <83ee8b3pme.fsf@gnu.org> <867fb020-c32b-3a42-1910-385756846c6d@cs.ucla.edu> <8335oq4j8z.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19574"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Cc: bug-gnulib@gnu.org, andrewjmoreton@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Sun Oct 24 19:05:58 2021 Return-path: Envelope-to: gnu-bug-gnulib@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 1megwX-0004ph-Uo for gnu-bug-gnulib@m.gmane-mx.org; Sun, 24 Oct 2021 19:05:57 +0200 Original-Received: from localhost ([::1]:54564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1megwW-0006I5-GY for gnu-bug-gnulib@m.gmane-mx.org; Sun, 24 Oct 2021 13:05:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1megwM-0006G9-A3; Sun, 24 Oct 2021 13:05:46 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1megwJ-0004rz-N6; Sun, 24 Oct 2021 13:05:45 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4595E16008C; Sun, 24 Oct 2021 10:05:40 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 3vFyt0vut-wQ; Sun, 24 Oct 2021 10:05:39 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 309331600AE; Sun, 24 Oct 2021 10:05:39 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zxKQB4ajv8pp; Sun, 24 Oct 2021 10:05:39 -0700 (PDT) Original-Received: from [172.18.16.180] (unknown [70.158.100.2]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 78B7716008C; Sun, 24 Oct 2021 10:05:38 -0700 (PDT) In-Reply-To: <8335oq4j8z.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -74 X-Spam_score: -7.5 X-Spam_bar: ------- X-Spam_report: (-7.5 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-3.33, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnulib" Xref: news.gmane.io gmane.comp.lib.gnulib.bugs:45179 gmane.emacs.devel:277667 Archived-At: On 10/24/21 9:58 AM, Eli Zaretskii wrote: > We could try all that, but not on the release branch. There, I'd like > a simple and safe fix. Is such a thing possible? Andy suggested a simple fix that I quoted here: https://lists.gnu.org/r/emacs-devel/2021-10/msg01698.html We could apply that patch just to ntlib.c and just in emacs-28 (do not merge to master) as Andy says that works for him; and we could then apply the more-systematic patch of to master. Andy's patch is definitely safe for GNU and POSIXish hosts. I don't know whether it suffices for all MS-Windows platforms and Emacs builds. > Can you explain why config.h is needed there, and why only for GCC 11? config.h is needed because it defines macros used by lib/string.h and other lib/*.h files that come from Gnulib. I don't know why the problem occurs only for GCC 11 on MS-Windows platforms, as I would think it'd also occur with earlier GCC versions. Older GCC versions don't do the static checking I mentioned, so the macros do not help checking with older GCC. The macros can safely be #defined to empty as Andy's patch suggested, so long as config.h isn't included (as it would define them differently). The downsides of Andy's approach (as compared to the more-systematic patch) is that you lose out some static checking with recent GCC, and I worry (without really knowing) that similar problems may lurk in other MS-Windows-specific .c files on some other MS-Windows platforms.