From owner-freebsd-arch Sun Jan 27 2:49:18 2002 Delivered-To: freebsd-arch@freebsd.org Received: from gull.prod.itd.earthlink.net (gull.mail.pas.earthlink.net [207.217.120.84]) by hub.freebsd.org (Postfix) with ESMTP id 6567A37B400; Sun, 27 Jan 2002 02:49:16 -0800 (PST) Received: from pool0039.cvx22-bradley.dialup.earthlink.net ([209.179.198.39] helo=mindspring.com) by gull.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16Umrh-0004p6-00; Sun, 27 Jan 2002 02:48:49 -0800 Message-ID: <3C53DB0B.6547EB76@mindspring.com> Date: Sun, 27 Jan 2002 02:48:43 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Chad David Cc: "Andrey A. Chernov" , "Brian F. Feldman" , Bruce Evans , arch@FreeBSD.ORG Subject: Re: strtod() References: <20020126162924.A7726@colnta.acns.ab.ca> <200201270453.g0R4rwi92912@green.bikeshed.org> <20020127070421.GA13415@nagual.pp.ru> <20020127003719.A38420@colnta.acns.ab.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Chad David wrote: > I just noticed that if you call printf() (or anything that will call > localeconv()) before you call strtod() etc. it works as it should. It > is the first call to localeconv() that causes errno to be updated when > it calls strtol(). After that localeconv() takes a short cut. So it > isn't really strtod()'s problem, but localeconv()'s. Good catch! > The attached patch fixes this case, and probably others. Comments? Uh, working around the problem this way adds overhead to a lot of places where it wasn't before. How about just initializing the shortcut completely? Worse comes to worse, call localeconv() in a .init by abusing the G++ linker set that gets run to construct virtual base clases and template classes the first time. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message