This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix strtol in Turkish locales (bug 19242)
- From: Florian Weimer <fweimer at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 19 Nov 2015 21:20:29 +0100
- Subject: Re: Fix strtol in Turkish locales (bug 19242)
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1511132205020 dot 15310 at digraph dot polyomino dot org dot uk>
On 11/13/2015 11:06 PM, Joseph Myers wrote:
> This patch makes the code check for the relevant ranges of letters
> rather than using toupper / isalpha (via macros) at all; locales
> remain used for whitespace testing (explicitly correct according to
> ISO C). Note that the way the code worked, the only non-ASCII letter
> that would previously have been accepted would have been the Turkish
> 'Ä' (dotless 'I'), because the uppercase version of that in Turkish
> locales is 'I'. This patch means that will no longer be accepted,
> which seems appropriate.
Have you tested the performance impact of this change? The locale-based
approach uses a lookup table, and it's not clear if the fairly involved
condition in the macro makes a difference. (This code is probably quite
performance-sensitive for some applications.)
Should sscanf have a test as well?
Thanks,
Florian