This is one those internal memos... I'm comparing 22.2.3.1.2, p3 to our current implementation, some things seem wrong. For instance, in __verify_grouping, when __j == __len, we exit the for loop, then enter it again with __j reset to zero and do the for loop again. This is not ok: instead, we should from now on keep __j fixed at __len - 1. Example: "\04\03\02", means that 12,34,56,789,0123 is ok, that is, the final \02 matches any number of initial two digits groups. Also, if a group has value <= 0 it means an unlimited size for the group (of course it's meaningful only as the last group) and should match *any* possible length for the first parsed group.
A value of CHAR_MAX for a group also means an unlimited group, and it's more interesting than zero, since the latter *cannot* actually occur in the stored grouping: \0 delimits the string returned by __nl_langinfo_l(GROUPING, __cloc);
Subject: Bug 13369 CVSROOT: /cvs/gcc Module name: gcc Changes by: paolo@gcc.gnu.org 2003-12-30 10:43:54 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: locale_facets.tcc Added files: libstdc++-v3/testsuite/22_locale/num_get/get/char: 13.cc libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t: 13.cc Log message: 2003-12-30 Paolo Carlini <pcarlini@suse.de> PR libstdc++/13369 * include/bits/locale_facets.tcc (__verify_grouping): Fix to deal properly with __grouping_tmp.size() > __grouping.size(). * testsuite/22_locale/num_get/get/char/13.cc: New. * testsuite/22_locale/num_get/get/wchar_t/13.cc: Ditto. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2190&r2=1.2191 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&r1=1.160&r2=1.161 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/13.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/13.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed for 3.4.0.
Subject: Bug 13369 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: paolo@gcc.gnu.org 2004-01-29 02:52:25 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: locale_facets.tcc Log message: 2004-01-28 Paolo Carlini <pcarlini@suse.de> PR libstdc++/13369 * include/bits/locale_facets.tcc (__verify_grouping): Fix to deal properly with __grouping_tmp.size() > __grouping.size(). Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.1464.2.177&r2=1.1464.2.178 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.82.4.17&r2=1.82.4.18