Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jan 2002 02:48:43 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Chad David <davidc@acns.ab.ca>
Cc:        "Andrey A. Chernov" <ache@nagual.pp.ru>, "Brian F. Feldman" <green@FreeBSD.ORG>, Bruce Evans <bde@zeta.org.au>, arch@FreeBSD.ORG
Subject:   Re: strtod()
Message-ID:  <3C53DB0B.6547EB76@mindspring.com>
References:  <20020126162924.A7726@colnta.acns.ab.ca> <200201270453.g0R4rwi92912@green.bikeshed.org> <20020127070421.GA13415@nagual.pp.ru> <20020127003719.A38420@colnta.acns.ab.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C53DB0B.6547EB76>