From owner-freebsd-standards@FreeBSD.ORG Fri Apr 25 07:08:10 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5FD2637B401 for ; Fri, 25 Apr 2003 07:08:10 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17AC843F85 for ; Fri, 25 Apr 2003 07:08:09 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h3PE7rE08393; Fri, 25 Apr 2003 16:07:53 +0200 (MEST) Date: Fri, 25 Apr 2003 16:07:53 +0200 (CEST) From: Harti Brandt To: Alexey Zelkin In-Reply-To: <200304251400.h3PE0TAZ009728@freefall.freebsd.org> Message-ID: <20030425160604.X76877@beagle.fokus.fraunhofer.de> References: <200304251400.h3PE0TAZ009728@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-standards@freebsd.org Subject: Re: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2003 14:08:10 -0000 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 AZ>To: "Sergey A. Osokin" 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> > 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> > 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