bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: free-posix: New module, renamed from 'free'


From: Paul Eggert
Subject: Re: free-posix: New module, renamed from 'free'
Date: Sat, 19 Dec 2020 13:43:47 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]