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

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

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

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

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

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

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

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

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

2020-05-27 Thread Daiki Ueno
Bruno Haible writes: > It would be useful to first concentrate on the first part, the refactoring > that introduces flags and RF_BINARY. This would provide a patch that is easier > to review and does not have the following problems: > - internal_fread_file still exists, although fread_file is

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

2020-05-27 Thread Steve Lhomme
Hi, On 2020-05-26 22:38, Bruno Haible wrote: Hi Steve, /* Ensure that declares GetFileSizeEx. */ +#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0500 # undef _WIN32_WINNT # define _WIN32_WINNT _WIN32_WINNT_WIN2K +#endif What do you gain by this? What does it bring to compile