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.emacs.devel Subject: Re: Android port Date: Sat, 05 Aug 2023 14:25:59 +0200 Message-ID: <3473524.ldcX8TXnAK@nimes> References: <1428589171.162865.1691134964773@mail1.libero.it> <4484333.4B0zn089NQ@nimes> <83msz5sn66.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13464"; mail-complaints-to="usenet@ciao.gmane.io" Cc: angelo.g0@libero.it, luangruo@yahoo.com, eggert@cs.ucla.edu, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 05 14:27:01 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qSGN2-0003BX-TW for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Aug 2023 14:27:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSGMO-0007uq-53; Sat, 05 Aug 2023 08:26:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSGMM-0007uQ-5A for emacs-devel@gnu.org; Sat, 05 Aug 2023 08:26:18 -0400 Original-Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSGMJ-0000BL-Qs; Sat, 05 Aug 2023 08:26:17 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1691238360; cv=none; d=strato.com; s=strato-dkim-0002; b=G+twnWoOM0G2pZElxQJ03qeTN6RQn2UfSdNQceSlEpF7I15zgR0x9NCtmQb++fTkkH 7D9s6vO9HLR0qYSE1LFGuIIS57OKJtDQNxyuePJMVZboFHDX9g2dNTA1//TGVelUay4u HQXEevXk8HoKUQgmN+6cfGciGXIO44wzdhGW+p4JhdkABu1JRyvsYi2+8jQlp+1Yeii+ lil0I1CvGR1ayazmAY/YDOJOda76ipMxmTdziCFDcfsLB9Ov1D8xzPAH2eEn4e9DClqb oRSAyO0nIoLlVTf78rj+EnQBv56+TFRSmTxhaZPxhToW/zNHwTvPuz07quPc7U0GDfvt Sfrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1691238360; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=zE3De+UghIrq95n19WNuntGEMqA87lTlqRviJRPipqk=; b=K/XBRwJAriY3dgJXC7ns1zF8hrDo6M9kgA4SAt6T7UqkMifIJ3SMFo7IiC6eSpWKop LdGCs2iU0W7d0UYJlmaVRvUstiRTrKh3yLEq9VoWY7l0zA5Ov4UV8A7kDrWCMGs9ni29 9l888gPFwl7eZB7AoddSFDQ+okOyOF8lfCKqikizgGaFm1U4NcLoAzdI0rKxnxlzs5OE HbHhc/3p0k3CxYul/mUMQTbUHT0WJ06QhCouDosvz3pixs5TGD3XJFT+S3XDI0PkFSnx gBMyXzK8RUm60z1XNxgiBBPn1GPKE3/kj1oDHsh5cb728eZXc7gho7HjULOqpPLpDLUM Aihw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1691238360; 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=zE3De+UghIrq95n19WNuntGEMqA87lTlqRviJRPipqk=; b=kWK7lDEPk05+hoMYWJZ5Sn4FvXiFChnqNIyiyu1BvihmZGpnE2JTNlrfmAww11f4ou i8Ge1v0mVDe6b8brPQj2aHirTJsdnKIUB3CRMCUzMu8810Ka53bw98RQsTN0I3uBHmkV 4Z4HU21ndcVv1CrhPbg9hUbc+ciPjyfVoQ4ws7xzjlqcyn0FBr3h5oFZ/aiB8w7F7wrg YAfTgFrmQ8hE3xF/Zj6Xj02COSJJYDVyuoQdzUNyVe9DYddbYkBbkRerTTZO9LxdvYqY wLPtT3zyuKQd5mXu6XW9o14SqhcwadVnbeZJ6uS115a3gZigDzKo4xsGt4LlQ+mf1ogE s/Yg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1691238360; s=strato-dkim-0003; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=zE3De+UghIrq95n19WNuntGEMqA87lTlqRviJRPipqk=; b=8HMcr6utVtZiPWXDmEyTMRbRZU3tbFr+Iaz9y/GFkg2LkR0QK0fMT0j5JXwOs/g4yq /+ZakI5Vsm1LOpGlAHDA== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpOQjvJO92xURICTbiXlAvORnk3W3A==" Original-Received: from nimes.localnet by smtp.strato.de (RZmta 49.6.6 AUTH) with ESMTPSA id x129eaz75CPxWrL (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sat, 5 Aug 2023 14:25:59 +0200 (CEST) In-Reply-To: <83msz5sn66.fsf@gnu.org> Received-SPF: none client-ip=85.215.255.25; 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308315 Archived-At: Eli Zaretskii wrote: > > But from this error log: > > > > In file included from C:/msys64/tmp/emacs-bfbdf4eb892935536fc665d6cc986fd669364263/nt/inc/ms-w32.h:389, > > from ../src/conf_post.h:38, > > from ../src/config.h:3511, > > from printf.c:18: > > C:/msys64/mingw64/include/stdio.h:379:5: note: previous definition of 'printf' with type 'int(const char *, ...)' > > > > it seems that nt/inc/ms-w32.h directly includes from mingw, without > > the interposed lib/stdio.h. > > > > Do you have a lib/stdio.h in your build tree? Angelo replied "It seems no". And that is the problem. The generated stdio.h, on this platform, is supposed to contain macro definitions: #define asprintf rpl_asprintf #define printf __printf__ #define vasprintf rpl_vasprintf #define vfprintf rpl_vfprintf By omitting these macro definitions, there is a conflict between the inline definition in mingw's and the Gnulib replacement code. > The MinGW build omits building the Gnulib's stdio module. We did that > since 2017. The exact reasons are probably lost in time, but I can > assure you they were real, and I wouldn't want to reintroduce them for > this particular reason. It'd be worth a try nevertheless. Gnulib has changed a lot since 2017. > Since the *printf family doesn't need to be replaced in the Emacs > build on MS-Windows, I'd rather we understood why the above causes > compilation errors. See above. > Aren't Gnulib replacements for *printf functions > supposed to have prototypes compatible to the MinGW headers? No, Gnulib replacements always have different function names than the system function (except for the 'free' function). The reason is that there is so much variation in the prototypes of a function (with or without 'restrict', with or without 'throw()' in C++, with or without 'static' / 'inline'), that it would be extremely fragile to attempt to get the exact same prototype as the system. So, if you decided not to have a generated stdio.h, the simplest solution seems to be: 1) in the conf_post.h or nt/inc/ms-w32.h, include (this is the one from the system), 2) after this #include, add #define asprintf rpl_asprintf #define printf __printf__ #define vasprintf rpl_vasprintf #define vfprintf rpl_vfprintf and add prototypes for these 4 functions. Bruno