standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)

Harti Brandt brandt at fokus.fraunhofer.de
Fri Apr 25 07:08:10 PDT 2003


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 at FreeBSD.org.ua>
AZ>To: "Sergey A. Osokin" <osa at freebsd.org.ru>
AZ>Cc: FreeBSD-gnats-submit at 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 at fokus.fraunhofer.de, harti at freebsd.org


More information about the freebsd-standards mailing list