From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Haible Newsgroups: gmane.comp.lib.gnulib.bugs,gmane.emacs.devel Subject: Re: Emacs build fails on Windows mingw64 Date: Mon, 25 Oct 2021 00:52:45 +0200 Message-ID: <4097293.omi8TgXK3m@omega> References: <86v91nfp6e.fsf@gmail.com> <349dbe47-58a7-cc27-5dd5-408168820aeb@cs.ucla.edu> <86h7d61f1f.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10862"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andy Moreton , emacs-devel@gnu.org To: bug-gnulib@gnu.org Original-X-From: bug-gnulib-bounces+gnu-bug-gnulib=m.gmane-mx.org@gnu.org Mon Oct 25 00:53:42 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 1memN2-0002cE-MG for gnu-bug-gnulib@m.gmane-mx.org; Mon, 25 Oct 2021 00:53:41 +0200 Original-Received: from localhost ([::1]:57186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1memN1-00015r-5H for gnu-bug-gnulib@m.gmane-mx.org; Sun, 24 Oct 2021 18:53:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1memMH-0008Nc-D3; Sun, 24 Oct 2021 18:52:53 -0400 Original-Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.217]:23841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1memME-0004d8-VE; Sun, 24 Oct 2021 18:52:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1635115965; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=hIw4BNEzpYzrP5XimFFFHu8R7GzVl3JaypDqwF+QkoE=; b=lFF1xQ3HTaWd05UHkuYw5oX+GwVi9aBgFX/ZOA0pY2IxGkb6o7g9EnPcWw9KSNl0ia HwX4V0ZcCh0VNNbjGYXccHdT8A/A3ONP1oeIbbH11sU0CsDs2np4BRo6JWTj2RXBlMnr zdCMK343BfNV5A4a43Azw6QRCyZ84nCySqmvS9q9iTNmTuIuiZsLKptGz/Ulb9aShv2h xiswrhWzqlLOC9X5BbDAuJQEQA/d1J74Dqz5QAxQvVb9OPoS1HR8hkPeJTdJ1vs2VY4k LUMt0TFQF9+5oiFmZCcx+zrLm8LBeMkaOtmRlyTLYpcVZVVRIYWFvd2oLBRnKiRQbKq3 yFvQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94z26ll5ip69rxhaeRjn/W3W8z9nenE6KuHQAKA==" X-RZG-CLASS-ID: mo00 Original-Received: from omega.localnet by smtp.strato.de (RZmta 47.34.1 AUTH) with ESMTPSA id 501352x9OMqj9Hz (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 25 Oct 2021 00:52:45 +0200 (CEST) In-Reply-To: <86h7d61f1f.fsf@gmail.com> Received-SPF: none client-ip=81.169.146.217; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=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:45185 gmane.emacs.devel:277689 Archived-At: Andy Moreton wrote: > > 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; >=20 > Yes, that minimal fix bootstraps on emacs-28 and master with 64bit mingw6= 4. Thanks for the confirmation that the lack of definitions of _GL_ATTRIBUTE_MALLOC and _GL_ATTRIBUTE_DEALLOC_FREE was indeed the problem. Although Paul is right in saying that every file that uses Gnulib needs to , we make compromises regarding this requirement for the *.in.h files. The commit https://git.savannah.gnu.org/gitweb/?p=3Dgnulib.git;a=3Dcommitdiff;h=3D354f= 27fea9bd4ecb53980de6bd374434a204afc5 from 2021-08-22 "Make generated .in.h files as standalone as possible" added definitions of _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE, _GL_ATTRIBUTE_MALLOC to stdlib.h, and assumed that these definitions would also be visible in string.h, since string.h did a '#include '. The commit https://git.savannah.gnu.org/gitweb/?p=3Dgnulib.git;a=3Dcommitdiff;h=3Da4a2= d039a9117266ed8cb1977241e7c34b368993 from 2021-09-07 then removed this '#include ' from string.in.h. As a compensation, it added the declaration of free/rpl_free. But it needs also the macros _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE, _GL_ATTRIBUTE_MALLOC =E2=80=94 when is not pre-included. The issue was also reported to me in private mail by Jan Engelhardt, regarding the 'cdecl' package, on 2021-09-28, but I didn't have time to react then; sorry about that. This patch should fix it. 2021-10-24 Bruno Haible string: Avoid syntax error re strdup in string.in.h (regr. 2021-09-07). Reported by Jan Engelhardt and by Arash Esbati via Andy Moreton in . * lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE, _GL_ATTRIBUTE_MALLOC): Add fallback declarations, like in lib/stdlib.in.h. * lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE, _GL_ATTRIBUTE_MALLOC): Likewise. diff --git a/lib/string.in.h b/lib/string.in.h index 8d77ae380..afe735086 100644 =2D-- a/lib/string.in.h +++ b/lib/string.in.h @@ -67,6 +67,35 @@ # include #endif =20 +/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers + that can be freed by passing them as the Ith argument to the + function F. */ +#ifndef _GL_ATTRIBUTE_DEALLOC +# if __GNUC__ >=3D 11 +# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) +# else +# define _GL_ATTRIBUTE_DEALLOC(f, i) +# endif +#endif + +/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers = that + can be freed via 'free'; it can be used only after declaring 'free'. */ +/* Applies to: functions. Cannot be used on inline functions. */ +#ifndef _GL_ATTRIBUTE_DEALLOC_FREE +# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1) +#endif + +/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to fr= eshly + allocated memory. */ +/* Applies to: functions. */ +#ifndef _GL_ATTRIBUTE_MALLOC +# if __GNUC__ >=3D 3 || defined __clang__ +# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +# else +# define _GL_ATTRIBUTE_MALLOC +# endif +#endif + /* The __attribute__ feature is available in gcc versions 2.5 and later. The attribute __pure__ was added in gcc 2.96. */ #ifndef _GL_ATTRIBUTE_PURE diff --git a/lib/wchar.in.h b/lib/wchar.in.h index f13379ad8..20315dd7b 100644 =2D-- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -84,6 +84,35 @@ #ifndef _@GUARD_PREFIX@_WCHAR_H #define _@GUARD_PREFIX@_WCHAR_H =20 +/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers + that can be freed by passing them as the Ith argument to the + function F. */ +#ifndef _GL_ATTRIBUTE_DEALLOC +# if __GNUC__ >=3D 11 +# define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) +# else +# define _GL_ATTRIBUTE_DEALLOC(f, i) +# endif +#endif + +/* _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers = that + can be freed via 'free'; it can be used only after declaring 'free'. */ +/* Applies to: functions. Cannot be used on inline functions. */ +#ifndef _GL_ATTRIBUTE_DEALLOC_FREE +# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1) +#endif + +/* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to fr= eshly + allocated memory. */ +/* Applies to: functions. */ +#ifndef _GL_ATTRIBUTE_MALLOC +# if __GNUC__ >=3D 3 || defined __clang__ +# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +# else +# define _GL_ATTRIBUTE_MALLOC +# endif +#endif + /* The __attribute__ feature is available in gcc versions 2.5 and later. The attribute __pure__ was added in gcc 2.96. */ #ifndef _GL_ATTRIBUTE_PURE