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

Alexey Zelkin phantom at FreeBSD.org.ua
Fri Apr 25 07:00:31 PDT 2003


The following reply was made to PR standards/51292; it has been noted by GNATS.

From: Alexey Zelkin <phantom at FreeBSD.org.ua>
To: "Sergey A. Osokin" <osa at freebsd.org.ru>
Cc: FreeBSD-gnats-submit at freebsd.org
Subject: Re: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
Date: Fri, 25 Apr 2003 17:02:07 +0300

 hi,
 
 Well, answers below, but please consider my general point (same as Bruce's)
 I don't think that we need it at all.  SUSv3 marks these functions as
 legacy (i.e. deprecated) and suggest to use sprintf() instead (see
 APPLICATION USAGE section).
 
 On Fri, Apr 25, 2003 at 04:32:10PM +0400, Sergey A. Osokin wrote:
 > On Fri, Apr 25, 2003 at 03:19:37PM +0300, Alexey Zelkin wrote:
 > > On Fri, Apr 25, 2003 at 12:38:51PM +0400, Sergey A. Osokin wrote:
 > > 
 > > > > > >Number:         51292
 > > > > > >Category:       standards
 > > > > > >Synopsis:       [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
 
 [..]
 
 > > Actually, all these cases should be handled by setlocale() itself.  And
 > > after call to 'setlocale()' you should use lconv() to receive current
 > > radix character.
 > > I also would object to using of setlocale() from libc's function internally.
 > 
 > Hmm, but from SUSv3:
 > <quote>
 > The radix character is determined by the current locale.  If
 > setlocale() has not been called successfully, the default locale,
 > POSIX, is used.  The default locale specifies a period
 > ( '.' ) as the radix character.
 > </quote>
 
 And what?  It does not mean that setlocale() should be called
 in *cvt() functions.
 
 Can you ever count amount of possible problems caused by call to setlocale()
 in middle of libc function ?
 
 > > It's a application's problem to decide which locale to use and [fge]cvt()
 > > should use locale previously set by application.
 > 
 > AFAIK only gcvt() have locale-specific "problem".  I can't find
 > any locale-specific words in documentation of [ef]cvt.  Correct
 > me if I'm wrong...
 
 You may find 'radix character' related words there.
 


More information about the freebsd-standards mailing list