svn commit: r235266 - head/lib/libc/stdlib

Andrey Chernov ache at FreeBSD.ORG
Fri May 11 18:10:49 UTC 2012


On Fri, May 11, 2012 at 10:55:39AM -0700, Garrett Cooper wrote:
> On Fri, May 11, 2012 at 10:04 AM, Konstantin Belousov
> <kostikbel at gmail.com> wrote:
> > On Fri, May 11, 2012 at 06:54:32PM +0400, Andrey Chernov wrote:
> >> Thanks, but in this two places old errno value should be saved across
> >> free() because free() may damage it:
> > I do not agree. free() cannot change errno.
> 
>     It might depending on the OS (logically it shouldn't, but I
> digress), but there was some recent discussion on the POSIX list about
> errno not being mangled via free:
> http://austingroupbugs.net/view.php?id=385 .

Yes. The initial paragraph from it states pretty clear:

Line 25639 [XSH errno] is explicit that "The setting of errno after a
successful call to a function is unspecified unless the description of
that function specifies that errno shall not be modified." However,
free() does not mention its interaction with errno.

-- 
http://ache.vniz.net/


More information about the svn-src-head mailing list