This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix strtol in Turkish locales (bug 19242)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]