From owner-freebsd-arch Sun Jan 27 12: 6:40 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mail.acns.ab.ca (mail.acns.ab.ca [142.179.151.95]) by hub.freebsd.org (Postfix) with ESMTP id 5180837B402; Sun, 27 Jan 2002 12:06:36 -0800 (PST) Received: from colnta.acns.ab.ca (colnta.acns.ab.ca [192.168.1.2]) by mail.acns.ab.ca (8.11.6/8.11.3) with ESMTP id g0RK6QV14686; Sun, 27 Jan 2002 13:06:26 -0700 (MST) (envelope-from davidc@colnta.acns.ab.ca) Received: (from davidc@localhost) by colnta.acns.ab.ca (8.11.6/8.11.3) id g0RK6Pg42805; Sun, 27 Jan 2002 13:06:25 -0700 (MST) (envelope-from davidc) Date: Sun, 27 Jan 2002 13:06:25 -0700 From: Chad David To: "Andrey A. Chernov" Cc: "Brian F. Feldman" , Bruce Evans , arch@FreeBSD.ORG Subject: Re: strtod() Message-ID: <20020127130625.A42735@colnta.acns.ab.ca> Mail-Followup-To: "Andrey A. Chernov" , "Brian F. Feldman" , Bruce Evans , arch@FreeBSD.ORG 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020127105258.GA14836@nagual.pp.ru>; from ache@nagual.pp.ru on Sun, Jan 27, 2002 at 01:52:59PM +0300 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 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 and ends at 0x8050d16 . (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