This is the mail archive of the
mailing list for the glibc project.
Re: strxfrm output stability
- From: Florian Weimer <fweimer at redhat dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 8 Sep 2015 23:26:54 +0200
- Subject: Re: strxfrm output stability
- Authentication-results: sourceware.org; auth=none
- References: <55EF4F95 dot 4020703 at redhat dot com> <20150908211805 dot 36E5E2C3A73 at topped-with-meat dot com>
On 09/08/2015 11:18 PM, Roland McGrath wrote:
> The only thing that matters about strxfrm output is its strcmp ordering.
> If that changes, it's either a bug fix or a bug (either in the code or in
> the locale data). If the string contents change but the ordering doesn't,
> then it's an implementation detail that is allowed to change.
Why do you think that? I don't see this documented anywhere, and I
doubt it is something many readers of the C standard, the man page, or
the glibc manual would expect.
The manual suggests to store the strxfrm output and use it for sorting.
I expect that some applications put it into on-disk database indexes as
a result. This will lead to subtle breakage on glibc updates.
(The larger problem is that there are *definitely* databases out there
which use B-tree indexes in locale collation order, which break in even
more subtle ways if we make minor changes to the collation order.)
Florian Weimer / Red Hat Product Security