Re: [PATCH] free: preserve errno

2020-12-17 Thread Paul Eggert
Thanks for fixing that. It is amusing that after 45 years we are still fussing with the semantics of 'free'. You'd think it'd be simple, but no

Re: [PATCH] free: preserve errno

2020-12-17 Thread Bruno Haible
Pádraig Brady wrote: > coreutils is now failing to build with: > >lib/free.c:28:1: error: no previous declaration > for 'rpl_free' [-Werror=missing-declarations] > 28 | rpl_free (void *p) >| ^~~~ > > In early 2008 coreutils removed use of the then deprecated "free"

Re: Make more use of idx_t

2020-12-17 Thread Bruno Haible
Paul Eggert wrote: > If we're > going to have a macro that stands for PTRDIFF_WIDTH - 1 it'd probably be > better to use a different naming convention, to avoid that confusion. Makes sense. Yes, IDX_VALUE_BITS would be a better name than IDX_WIDTH. Bruno

Re: [PATCH] free: preserve errno

2020-12-17 Thread Pádraig Brady
On 17/12/2020 09:54, Paul Eggert wrote: * lib/free.c (rpl_free): Preserve errno. Check for null only if CANNOT_FREE_NULL is defined, as an optimization for POSIX 2008 platforms that do not preserve errno. * m4/free.m4 (gl_FUNC_FREE): Check whether free preserves errno. Also, define

Re: [PATCH 1/6] canonicalize-lgpl: fix EOVERFLOW bug

2020-12-17 Thread Paul Eggert
On 12/11/20 5:03 AM, Adhemerval Zanella wrote: I have sent a similar fix to reviews for this very issue for glibc (which is based on the canonicalize-lgpl) along with other fixes that you might take a look at [1]. Thanks, I looked at that when composing the patches I just now installed into

Re: [PATCH] tmpdir: Add function to create a unique temp directory.

2020-12-17 Thread John Darrington
On Thu, Dec 17, 2020 at 12:26:20AM +0100, Bruno Haible wrote: So, it differs from 'create_temp_dir' only in the aspect that it does NOT do automatic cleanup. Since you are already aware of the 'clean-temp' module — you contributed to it 8 years ago :) — what could

Re: [PATCH 2/6] canonicalize: fix EOVERFLOW bug

2020-12-17 Thread Paul Eggert
On 12/14/20 10:05 AM, Bruno Haible wrote: But canonicalize-lgpl.c had similar changes, and it has a similar failure on AIX 7.2, still today: ../../gltests/test-canonicalize-lgpl.c:100: assertion 'result == NULL' failed FAIL test-canonicalize-lgpl (exit status: 134) Probably your changes

Re: Make more use of idx_t

2020-12-17 Thread Paul Eggert
On 12/6/20 3:32 AM, Bruno Haible wrote: Paul Eggert wrote: Those all look good to me. OK, I pushed them. When I looked into this a bit more when hacking on canonicalize-lgpl, I realized I spoke too soon. First, there's some cruft left over from when idx_t could be unsigned. More

[PATCH] free: preserve errno

2020-12-17 Thread Paul Eggert
* lib/free.c (rpl_free): Preserve errno. Check for null only if CANNOT_FREE_NULL is defined, as an optimization for POSIX 2008 platforms that do not preserve errno. * m4/free.m4 (gl_FUNC_FREE): Check whether free preserves errno. Also, define CANNOT_FREE_NULL if free cannot free NULL. *