Date: Sun, 27 Jan 2002 13:06:25 -0700 From: Chad David <davidc@acns.ab.ca> To: "Andrey A. Chernov" <ache@nagual.pp.ru> Cc: "Brian F. Feldman" <green@FreeBSD.ORG>, Bruce Evans <bde@zeta.org.au>, arch@FreeBSD.ORG Subject: Re: strtod() Message-ID: <20020127130625.A42735@colnta.acns.ab.ca> In-Reply-To: <20020127105258.GA14836@nagual.pp.ru>; from ache@nagual.pp.ru on Sun, Jan 27, 2002 at 01:52:59PM %2B0300 References: <20020126162924.A7726@colnta.acns.ab.ca> <200201270453.g0R4rwi92912@green.bikeshed.org> <20020127070421.GA13415@nagual.pp.ru> <20020127003719.A38420@colnta.acns.ab.ca> <20020127083529.GA13957@nagual.pp.ru> <20020127024626.B40668@colnta.acns.ab.ca> <20020127105258.GA14836@nagual.pp.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 27, 2002 at 01:52:59PM +0300, Andrey A. Chernov wrote: > On Sun, Jan 27, 2002 at 02:46:26 -0700, Chad David wrote: > > > How would you fix it? I'm not sure errno should get modified just because > > a locale has an invalid entry? Do you fix the locale (if so how??), or do > > you make the code a little more robust? > > I see no invaliad entries in -current default monetary locale. Your code > base seems a bit obsoleted, run your tests on -current and report back. > Your patch is not for -current too, cnv is different in -current. Sorry I had grabbed an earlier version of localeconv.c (1.3) after one of bde's comments. Really the differences between 1.3 and 1.9 are very minor and do not affect this problem (other then my patch wouldn't work). As I said, I don't really understand the locale code, but this structure is being returned empty (I have a statically linked libc, and I walked the whole thing in gdb). If I am missing something obvious please point in out to me :). (gdb) info line Line 86 of "/mnt1/devel/work/dev/bsd/FreeBSD/src/lib/libc/../libc/locale/localeconv.c" starts at address 0x8050d0e <localeconv+74> and ends at 0x8050d16 <localeconv+82>. (gdb) p mptr $3 = (struct lc_monetary_T *) 0x80529c0 (gdb) p *mptr $4 = {int_curr_symbol = 0x80549ac "", currency_symbol = 0x80549ac "", mon_decimal_point = 0x80549ac "", mon_thousands_sep = 0x80549ac "", mon_grouping = 0x80549ad "\177", positive_sign = 0x80549ac "", negative_sign = 0x80549ac "", int_frac_digits = 0x80549ad "\177", frac_digits = 0x80549ad "\177", p_cs_precedes = 0x80549ad "\177", p_sep_by_space = 0x80549ad "\177", n_cs_precedes = 0x80549ad "\177", n_sep_by_space = 0x80549ad "\177", p_sign_posn = 0x80549ad "\177", n_sign_posn = 0x80549ad "\177"} colnta->cvs status lmonetary.c =================================================================== File: lmonetary.c Status: Up-to-date Working revision: 1.11 Fri Jan 18 09:14:39 2002 Repository revision: 1.11 /mnt1/ncvs/src/lib/libc/locale/lmonetary.c,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none) This looks pretty empty to me. ... static char empty[] = ""; static char numempty[] = { CHAR_MAX, '\0'}; static const struct lc_monetary_T _C_monetary_locale = { empty, /* int_curr_symbol */ empty, /* currency_symbol */ empty, /* mon_decimal_point */ empty, /* mon_thousands_sep */ numempty, /* mon_grouping */ empty, /* positive_sign */ empty, /* negative_sign */ numempty, /* int_frac_digits */ numempty, /* frac_digits */ numempty, /* p_cs_precedes */ numempty, /* p_sep_by_space */ numempty, /* n_cs_precedes */ numempty, /* n_sep_by_space */ numempty, /* p_sign_posn */ numempty /* n_sign_posn */ }; ... -- Chad David davidc@acns.ab.ca www.FreeBSD.org davidc@freebsd.org ACNS Inc. Calgary, Alberta Canada Fourthly, The constant breeders, beside the gain of eight shillings sterling per annum by the sale of their children, will be rid of the charge of maintaining them after the first year. - Johnathan Swift 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?20020127130625.A42735>