Date: Fri, 25 Apr 2003 16:07:53 +0200 (CEST) From: Harti Brandt <brandt@fokus.fraunhofer.de> To: Alexey Zelkin <phantom@FreeBSD.org.ua> Cc: freebsd-standards@freebsd.org Subject: Re: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3) Message-ID: <20030425160604.X76877@beagle.fokus.fraunhofer.de> In-Reply-To: <200304251400.h3PE0TAZ009728@freefall.freebsd.org> References: <200304251400.h3PE0TAZ009728@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 25 Apr 2003, Alexey Zelkin wrote: AZ>The following reply was made to PR standards/51292; it has been noted by GNATS. AZ> AZ>From: Alexey Zelkin <phantom@FreeBSD.org.ua> AZ>To: "Sergey A. Osokin" <osa@freebsd.org.ru> AZ>Cc: FreeBSD-gnats-submit@freebsd.org AZ>Subject: Re: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3) AZ>Date: Fri, 25 Apr 2003 17:02:07 +0300 AZ> AZ> hi, AZ> AZ> Well, answers below, but please consider my general point (same as Bruce's) AZ> I don't think that we need it at all. SUSv3 marks these functions as AZ> legacy (i.e. deprecated) and suggest to use sprintf() instead (see AZ> APPLICATION USAGE section). AZ> AZ> On Fri, Apr 25, 2003 at 04:32:10PM +0400, Sergey A. Osokin wrote: AZ> > On Fri, Apr 25, 2003 at 03:19:37PM +0300, Alexey Zelkin wrote: AZ> > > On Fri, Apr 25, 2003 at 12:38:51PM +0400, Sergey A. Osokin wrote: AZ> > > AZ> > > > > > >Number: 51292 AZ> > > > > > >Category: standards AZ> > > > > > >Synopsis: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3) AZ> AZ> [..] AZ> AZ> > > Actually, all these cases should be handled by setlocale() itself. And AZ> > > after call to 'setlocale()' you should use lconv() to receive current AZ> > > radix character. AZ> > > I also would object to using of setlocale() from libc's function internally. AZ> > AZ> > Hmm, but from SUSv3: AZ> > <quote> AZ> > The radix character is determined by the current locale. If AZ> > setlocale() has not been called successfully, the default locale, AZ> > POSIX, is used. The default locale specifies a period AZ> > ( '.' ) as the radix character. AZ> > </quote> AZ> AZ> And what? It does not mean that setlocale() should be called AZ> in *cvt() functions. AZ> AZ> Can you ever count amount of possible problems caused by call to setlocale() AZ> in middle of libc function ? I suppose localeconv()->decimal_point is the correct way to obtain the period? That's at what vfprintf() does. harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030425160604.X76877>