svn commit: r250245 - head/lib/libc/locale

Andrey Chernov ache at freebsd.org
Mon May 6 10:35:56 UTC 2013


On 06.05.2013 1:03, David Chisnall wrote:
> On 5 May 2013, at 19:31, Andrey Chernov <ache at FreeBSD.org> wrote:
> 
>> It is better to fix this function return type to match POSIX standard
>> rather than to document its non-standard behavior. We try to follow
>> POSIX when possible and this is the case.
> 
> We follow Darwin in this case, which returns 0 on success or -1 on error.  
> 'Fixing' this will break code written for Darwin and testing the
return value.

Well, keeping in mind that POSIX now 'owns' almost all of the same
interface, how many 3rd party soft authors will follow Darwin instead of
POSIX, which claims cross-platform compatibility?
Darwin is live as implementation but already dead as interface in its
common parts differences with POSIX.

I remember almost the same discussion about free(3) return code which
was int, but finally changed to POSIX void.

> Not fixing it will not break POSIX code that ignores the (unexpected)
return value.

Not always so. I.e. passing freelocale() by pointer breaks POSIX
compatibility in case calling function expects pointer to void function.

-- 
http://ache.vniz.net/
bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N


More information about the svn-src-all mailing list