On 12/19/20 1:28 PM, Bruno Haible wrote:
when you write
int saved_errno = errno;
free (ptr);
errno = saved_errno;
GCC may transform this to just
free (ptr);
Reported at<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98396> .
Ouch. Yet another reason 'free' should preserve errno. The GCC problem also
seems to affect malloc.
Luckily GCC does not seem to do these incorrect transformations to Gnulib's
current code (in particular, to lib/free.c) at least not on my platform (gcc
10.2.0-13ubuntu, x86-64). Don't know why, but thank goodness for small favors.