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.devel Subject: Re: Compiling in mingw-ucrt runtime Date: Tue, 02 Apr 2024 19:28:16 +0300 Message-ID: <86a5mbafvj.fsf@gnu.org> References: <6153309.usfYGdeWWP@nimes> <86r0h0wp78.fsf@gnu.org> <30790436.gRfpFWEtPU@nimes> <86plwkwmzn.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29282"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bruno@clisp.org, emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 02 18:29:13 2024 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 1rrh0b-0007MI-18 for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Apr 2024 18:29:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrh0P-0005PY-1q; Tue, 02 Apr 2024 12:29:02 -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 1rrh0J-0005Dy-Tc for emacs-devel@gnu.org; Tue, 02 Apr 2024 12:28:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrh0I-0003Kj-U6; Tue, 02 Apr 2024 12:28:54 -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=aQA9hu8VC7pMJtOADIMyDKKYdUQP8qmAwm+ZBb2YYNA=; b=JNKzYtJNYXrX eSoGa4cFyPgrItRS3EmQm2r5BKUDC+l6jDrM8M0xMfjFXBHyrDIKEn8BJw6rcs+c3eSXv/awdPFhf 2FlVTirL6hN3fR64PRmEciHuUKo0+rYY7bn0eqfHN4nGiEdfvNExL5s+lL0PJU8stHv85lR4b08en EnRcl6YHLF5/wTXXcSglQ8HMKnDO7sw3rVp3DmnlzBVpDcV1W9pGL4WQJ+Q0ZLknBhWpZM0olqX70 9qduRcctj2TG5ButrEuAerKUdY16BqrJS3BNZWgfrXPzW1rnfey3eT+ihXQH3lC4R9JYUxLRQQtdg sspSghfXvcPgjTlRZL3f4w==; In-Reply-To: (message from Arthur Miller on Tue, 02 Apr 2024 17:30:25 +0200) 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:317465 Archived-At: > From: Arthur Miller > Cc: Bruno Haible , emacs-devel@gnu.org > Date: Tue, 02 Apr 2024 17:30:25 +0200 > > Eli Zaretskii writes: > > >> From: Bruno Haible > >> Cc: arthur.miller@live.com, emacs-devel@gnu.org > >> Date: Sun, 25 Feb 2024 16:32:59 +0100 > >> > >> On Sonntag, 25. Februar 2024 16:14:51 CET Eli Zaretskii wrote: > >> > > From: Bruno Haible > >> > > Cc: arthur.miller@live.com, emacs-devel@gnu.org > >> > > Date: Sun, 25 Feb 2024 16:05:54 +0100 > >> > > > >> > > > Strange that they claim that, because their sources tell a different > >> > > > story, both for MSVCRT and for UCRT. Or maybe your interpretation of > >> > > > what they say there is inaccurate? > >> > > > >> > > Re MSVCRT: My reading of Vc7/crt/src/fclose.c is that it never sets errno. > >> > > >> > fclose.c doesn't, indeed, but it calls _close (in close.c), which > >> > does. > >> > >> OK, so when it calls _close() and that fails, errno gets set. Good. > >> Still, fclose() can also fail due to !inuse(stream), in which case errno does > >> not get set. > >> > >> > > Re UCRT: My reading of ucrt-10.0.10240.0/stdio/fclose.cpp > >> > > and 10.0.14393.0/ucrt/stdio/fclose.cpp > >> > > is that errno gets set to EINVAL if the stream argument is invalid, > >> > > and remains unchanged otherwise. > >> > > >> > I do see errno being set in close.cpp, which fclose.cpp calls to do > >> > the actual job. > >> > >> Likewise here: Still, fclose() can also fail due to !stream.is_in_use(), in > >> which case errno does not get set. > > > > Yes, I agree that it doesn't set errno in all the cases where it > > fails. But that's a far cry from saying that errno is always > > undefined after it fails. > > > > And the question still stands why does it fail in Emacs in such a way. > > Just a short question: did you got anywhere further with this? You are asking me or Bruno? I've been waiting for Bruno to come back and tell more about what happens with UCRT in this case. > Where did you look at the source? Are they installed with their (MS) command > line tools or do I have to install the entire VS/Windows devkti for the sources? If you are asking about UCRT sources, they are freely available on the Internet, just search for them and you will find them promptly. (AFAIU, you also get them if you install some version of Studio or other, but I didn't install it.)