standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions
(SUSv3)
Sergey A. Osokin
osa at freebsd.org.ru
Fri Apr 25 01:40:18 PDT 2003
The following reply was made to PR standards/51292; it has been noted by GNATS.
From: "Sergey A. Osokin" <osa at freebsd.org.ru>
To: Alexey Zelkin <phantom at FreeBSD.org.ua>
Cc: FreeBSD-gnats-submit at freebsd.org
Subject: Re: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
Date: Fri, 25 Apr 2003 12:38:51 +0400
On Fri, Apr 25, 2003 at 12:30:12AM +0300, Alexey Zelkin wrote:
> hi,
>
> On Wed, Apr 23, 2003 at 12:26:47AM +0400, Sergey A.Osokin wrote:
> >
> > >Number: 51292
> > >Category: standards
> > >Synopsis: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
>
> Few questions related to code:
>
> 1. What's a reason to have some LANG handling logic here ?
Because standart says:
The radix character is determined by the current locale.
Follow this way: check LANG, then set locale.
> 2. Did you check correctness of dtoa()'s usage here ? It's not easy
> and after last netlib's import it become more uneasy.
I create a little test proram:
---- test.c ---
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char buff[255];
double value = -1000.010101011;
char *link;
link = buff;
gcvt(value, 16, link);
printf("%s\n", buff);
return 0;
}
---- test.c ---
$ cc -Wall -g 1.c -o 1
$ LANG=C ./1
-1000.010101011
$ LANG=ru_RU.KOI8-R ./1
-1000,010101011
Looks like it works, isn't it?
--
Rgdz, /"\ ASCII RIBBON CAMPAIGN
Sergey Osokin aka oZZ, \ / AGAINST HTML MAIL
http://ozz.pp.ru/ X AND NEWS
/ \
More information about the freebsd-standards
mailing list