Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Apr 2003 11:00:24 -0700 (PDT)
From:      Alexey Zelkin <phantom@FreeBSD.org.ua>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
Message-ID:  <200304251800.h3PI0OU5061150@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR standards/51292; it has been noted by GNATS.

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

 hi,
 
 On Fri, Apr 25, 2003 at 07:33:06PM +0400, Sergey A. Osokin wrote:
  
 > 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?
 
 No.
 
 1. 'if' statement will never return in this case.  It's possible for setlocale()
 to retrun at 'set' request, but this is 'get' request.  And if previously
 setlocale() was never called, default locale caregory name ("C") will be
 returned.
 
 2. Even in case if setlocale() was never called, or setlocale() call
 for LC_NUMERIC category was failed before -- it always will be used default
 "C" locale settings.  They're staticly available from libc. It's
 are always guaranted that localeconv() will return reasonable values
 (current or default)
 


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304251800.h3PI0OU5061150>