Re: Warnings in count-one-bits.h

2020-05-27 Thread Bruno Haible
[Please keep the mailing list in CC.] Gisle Vanem wrote: > > What is this clang-cl compiler? Is it disguising itself as _MSC_VER ? > > Yes. "clang-cl == clang --driver-mode=cl". I see. And, like for the GCC disguise, probably this disguise is not perfect either... Let's hope that it works for th

Re: Module suggestion: Atomic operations

2020-05-27 Thread Bruno Haible
Hi Marc, > At least one type in is guaranteed to be > lock-free, the atomic flag. Since C18, it can be used in signal > handlers, where Posix locks won't work because they are not > async-safe. Moreover, provides memory fences, which I > don't know how to emulate in general and which also seem t

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-27 Thread Bruno Haible
Hi Daiki, > Here are the two separate commits for this. The first one is nearly perfect. Only the NEWS entry should go into section "User visible incompatible changes", not into section "Important general notes". The second one: - In fread_file, around line 100, you use a realloc workaround th

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-27 Thread Daiki Ueno
Bruno Haible writes: > The first one is nearly perfect. Only the NEWS entry should go into section > "User visible incompatible changes", not into section "Important general > notes". > > The second one: > - In fread_file, around line 100, you use a realloc workaround that appears > to be

Re: portability of fopen and 'e' (O_CLOEXEC) flag

2020-05-27 Thread Bruno Haible
> Here are proposed patches for other modules. Does this look right? There were no objections. I pushed the changes. Bruno

use O_CLOEXEC in more places

2020-05-27 Thread Bruno Haible
The gnulib module 'open' supports O_CLOEXEC since 2017-08-14. We can use it to make multithreaded application that call fork() and exec() more robust. Here are proposed patches. How about module 'fts'? Should the directory fds that it allocates also be made O_CLOEXEC? 2020-05-27 Bruno Haible

Re: use O_CLOEXEC in more places

2020-05-27 Thread Bernhard Voelker
On 2020-05-27 20:43, Bruno Haible wrote: > How about module 'fts'? Should the directory fds that it allocates also be > made O_CLOEXEC? +1 I doubt that passing on those fds to any child is wanted/necessary. At least that would be a bug for coreutils (rm,du,chmod,chgrp,chcon) and findutils (find).

Re: use O_CLOEXEC in more places

2020-05-27 Thread Jim Meyering
On Wed, May 27, 2020, 11:44 Bruno Haible wrote: > The gnulib module 'open' supports O_CLOEXEC since 2017-08-14. We can use it > to make multithreaded application that call fork() and exec() more robust. > > Here are proposed patches. > > How about module 'fts'? Should the directory fds that it al

getopt.c warnings patch

2020-05-27 Thread Paul J. Lucas
The getopt.c file generates the following warnings from Apple’s gcc (Apple clang version 11.0.3 (clang-1103.0.32.62)): getopt.c:208:21: warning: implicit conversion changes signedness: 'long' to 'size_t' (aka '

Re: use O_CLOEXEC in more places

2020-05-27 Thread Paul Eggert
On 5/27/20 11:43 AM, Bruno Haible wrote: > How about module 'fts'? Should the directory fds that it allocates also be > made O_CLOEXEC? Yes, I'd say so; I see little reason for a child process to continue an fts scan.

Re: getopt.c warnings patch

2020-05-27 Thread Bruno Haible
Hi, Paul J. Lucas wrote: > The getopt.c file generates the following warnings from Apple’s gcc (Apple > clang version 11.0.3 (clang-1103.0.32.62)): > > > getopt.c:208:21: warning: implicit conversion changes signedn

Re: [PATCH v2] win32: don't force _WIN32_WINNT to a lower version

2020-05-27 Thread Bruno Haible
Hi Steve, > When building for UWP it's particularly important as a lot of APIs may > be hidden if you use the proper values and they are hidden because you > shouldn't use them. Forcing to use them when they shouldn't will lead to > apps that don't run. Oh, so Microsoft is not only adding new

Re: [PATCH 1/2] stat: use a CHAR instead of TCHAR with GetFinalPathNameByHandleA

2020-05-27 Thread Bruno Haible
Hi Steve, > The GetProcAddress uses the ANSI version of the API so the proper type for the > string is LPSTR, as found here: > > https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlea > --- > lib/stat-w32.c | 2 +- > 1 file changed, 1 insertion(+), 1 dele

Re: [PATCH 1/2] stat: use a CHAR instead of TCHAR with GetFinalPathNameByHandleA

2020-05-27 Thread Jeffrey Walton
On Wed, May 27, 2020 at 8:43 PM Bruno Haible wrote: > > > The GetProcAddress uses the ANSI version of the API so the proper type for > > the > > string is LPSTR, as found here: > > > > https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlea > > --- > > lib

Re: [PATCH v2] win32: don't force _WIN32_WINNT to a lower version

2020-05-27 Thread Steve Lhomme
On 2020-05-28 2:12, Bruno Haible wrote: Hi Steve, Hi Bruno, When building for UWP it's particularly important as a lot of APIs may be hidden if you use the proper values and they are hidden because you shouldn't use them. Forcing to use them when they shouldn't will lead to apps that don't ru

Re: [PATCH] gettimeofday: do not use LoadLibrary when built for Windows Store apps

2020-05-27 Thread Steve Lhomme
Any update on this patch ? On Dekstop it's better to use kernel32.dll as it's loaded with every process, so the LoadLibrary is not loading any new DLL. On Winstore/UWP apps you cannot use LoadLibrary, only LoadLibraryFromApp which cannot be used to load system DLLs. Static linking in necessar

Re: [PATCH 2/2] stat: do not use LoadLibrary when built for Windows Store apps

2020-05-27 Thread Steve Lhomme
Any update on this ? Just as in gettimeofday, one cannot use LoadLibrary to load system DLLs in UWP builds. But they are available by static linking with windowsapp and are guaranteed to be there. On 2020-05-19 8:26, Steve Lhomme wrote: LoadLibrary is forbidden in such apps (can only load DL

Re: bug#41558: Regexp Bug

2020-05-27 Thread Norihiro Tanaka
On Tue, 26 May 2020 21:14:12 -0700 "anton.paras" wrote: > I posted to Stack Exchange, and they recommended that I file a bug. I'd > rather not copy+paste it all, so here's the link: > > > > https://unix.stackexchange.com/questions/579889/why-doesnt-this-sed-command-replace-the-3rd-to-last-a