emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling in mingw-ucrt runtime


From: Arthur Miller
Subject: Re: Compiling in mingw-ucrt runtime
Date: Wed, 03 Apr 2024 15:09:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Arthur Miller <arthur.miller@live.com>
>> Cc: Bruno Haible <bruno@clisp.org>,  emacs-devel@gnu.org
>> Date: Tue, 02 Apr 2024 17:30:25 +0200
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> From: Bruno Haible <bruno@clisp.org>
>> >> 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 <bruno@clisp.org>
>> >> > > 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.

Anyone and no one in particular, just curious if you or someone else have found
what could be the problem.

>> 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

Yes. I got an impression you were looking at some Windows sources,
because of the path in this sentence of yours:

> My reading of Vc7/crt/src/fclose.c is that it never sets errno.


> 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.)

I took a look now. The only one I found freely on GH is someone's private
repository, "huangqinjin", with some commits, by them, so I don't want
to download that one.

I don't see any official ucrt repository amongst the 6.2k on MS Github. Perhaps
it is there, but tucked under some other project.

On SX they say, ucrt sources are distributed with SDKs, so I guess I'll download
Windows SDK anyway. I wanted to spare myself of VS and their SDKs, it is
gigabytes of downloads I don't need otherwise.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]