Re: [PATCH] free: preserve errno

2020-12-18 Thread Bruno Haible
I wrote: > * lib/stdlib.in.h (free): New declaration. Oops, I forgot to check this declaration in the test suite. 2020-12-18 Bruno Haible free-posix: Add C++ declaration test. * tests/test-stdlib-c++.cc (free): New declaration. diff --git a/tests/test-stdlib-c++.cc

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

[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. *