From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/748 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: musl 0.8.9 released Date: Sun, 22 Apr 2012 14:05:03 -0400 Message-ID: <20120422180503.GI14673@brightrain.aerifal.cx> References: <20120420020626.GC14673@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1335117747 16805 80.91.229.3 (22 Apr 2012 18:02:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 22 Apr 2012 18:02:27 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-749-gllmg-musl=m.gmane.org@lists.openwall.com Sun Apr 22 20:02:26 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1SM178-0004IG-Hj for gllmg-musl@plane.gmane.org; Sun, 22 Apr 2012 20:02:22 +0200 Original-Received: (qmail 18322 invoked by uid 550); 22 Apr 2012 18:02:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18299 invoked from network); 22 Apr 2012 18:02:21 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:748 Archived-At: On Sun, Apr 22, 2012 at 02:19:53PM +0200, Pascal Cuoq wrote: > On Fri, Apr 20, 2012 at 4:06 AM, Rich Felker wrote: > >    Bug-fix release for a serious breakage in strtol and related > >    functions that made it into the previous release and prevents them > >    from handling numbers with initial spaces. > > Sorry for arriving after the battle, and it is nowhere near as serious, but: > > src/internal/floatscan.c, line 136: > > /* Align incomplete final B1B digit */ > if (k > The condition k with at most k == KMAX-2. > You probably meant: > > if (k < KMAX-2 && j). > > If you took a bit of safety margin in your choice of KMAX limits, it > seems to me that it may never matter. But if this is the case, why > bother testing k at all? Indeed. There's plenty of extra space in the array because it has to be rounded up to power-of-two size to avoid expensive mod operations. Actually, since we only ever inc/dec, I wonder if I should just replace the masking with a conditional add/sub of KMAX after the inc/dec; then I could eliminate all the wasted stack space by using a much smaller value (roughly LDBL_EXP_MAX/12). In any case, the code does need to ensure that incrementing z does not overflow in the decimal-point-alignment code that follows, so for now I'll just make some changes that remove the redundant check and ensure (perhaps overly careful) that we don't wrap.. Rich