[PATCH] strfmon_l: Use specified locale for number formatting [BZ #19633]

Florian Weimer fweimer@redhat.com
Thu Feb 25 21:34:00 GMT 2016


strfmon_l incorrectly applied global locale settings to number
formatting because printf_fp could only look at the global locale.

The new test tries to exercise the (in)dependence of a few LC_MONETARY
properties.  Some of the locales I used for testing might be buggy.

I introduced new helper macros to index the locale data in a locale_t
object.  A future cleanup opportunity is the _NL_CURRENT redefinition in
strfmon_l itself.  __guess_grouping should be moved out of printf_fp.c,
with a proper prototype in a header file.

I saw some ldbl_hidden_def thing.  I fear it is used by ld-as-a-functor
magic to work around the lack of templates in C.  What I did should
hopefully be safe.

Martin, does this patch match what you had in mind?

Thanks,
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-strfmon_l-Use-specified-locale-for-number-formatting.patch
Type: text/x-patch
Size: 15204 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160225/90dcd53f/attachment.bin>


More information about the Libc-alpha mailing list