From owner-freebsd-standards@FreeBSD.ORG Fri Apr 25 08:40:13 2003 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C3DA137B401 for ; Fri, 25 Apr 2003 08:40:13 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4AE1043FBD for ; Fri, 25 Apr 2003 08:40:13 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h3PFeCUp084529 for ; Fri, 25 Apr 2003 08:40:12 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h3PFeCv4084528; Fri, 25 Apr 2003 08:40:12 -0700 (PDT) Date: Fri, 25 Apr 2003 08:40:12 -0700 (PDT) Message-Id: <200304251540.h3PFeCv4084528@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: "Sergey A. Osokin" 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 Reply-To: "Sergey A. Osokin" List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2003 15:40:14 -0000 The following reply was made to PR standards/51292; it has been noted by GNATS. From: "Sergey A. Osokin" To: Alexey Zelkin Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3) Date: Fri, 25 Apr 2003 19:33:06 +0400 On Fri, Apr 25, 2003 at 05:02:07PM +0300, Alexey Zelkin wrote: > 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: > > > > 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. > > > > 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 ? BTW if (setlocale(LC_NUMERIC, NULL) == NULL) { radix = '.'; n_sign = '-'; p_sign = '+'; } else { lc = localeconv(); radix = *lc->decimal_point; n_sign = *lc->negative_sign; p_sign = *lc->positive_sign; } Correct? > > > 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. -- Rgdz, /"\ ASCII RIBBON CAMPAIGN Sergey Osokin aka oZZ, \ / AGAINST HTML MAIL http://ozz.pp.ru/ X AND NEWS / \