This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] FP printing, take 2
- From: kaih at khms dot westfalen dot de (Kai Henningsen)
- To: gcc-patches at gcc dot gnu dot org
- Date: 01 Sep 2004 11:49:00 +0200
- Subject: Re: [v3] FP printing, take 2
- Comment: Unsolicited commercial mail will incur an US$100 handling fee per received mail.
- Organization: Organisation? Me?! Are you kidding?
- References: <16691.54895.612575.291103@localhost.localdomain> <16691.54895.612575.291103@localhost.localdomain> <4134DB04.4000809@computer.org>
gp.bolton@computer.org (Gawain Bolton) wrote on 31.08.04 in <4134DB04.4000809@computer.org>:
> Yes I have one comment... Maybe question actually because I must
> admit, I don't know the first thing about the locale part of
> libstdc++! The following lines strike me as odd:
>
> *__sbuf++ = __digits[*__buf++ - '0'];
>
> *__tb-- = '0' + (__decp % 10);
>
> Here the implicit assumption seems to be that the character set used
> orders the digits in successive increasing order from '0' to '9', which
> is true of ASCII.
>
> Is this a valid assumption for the locale library?
I vaguely recall this being demanded by the C standard ... in any case,
I'm pretty sure it is true of evry character set I ever saw. Most
importantly, it is true for EBCDIC (digits are F0 .. F9) and of every set
of decimal digits in Unicode - and of course for everything based on ASCII
(such as the ISO8859 family).
(It really was not necessary to quote the whole fourty kilobytes patch!)
MfG Kai