delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/02/23/12:51:44

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Mon, 23 Feb 2004 12:51:05 -0500
Message-Id: <200402231751.i1NHp5lv022894@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <403A301C.E8F5FE65@yahoo.com> (message from CBFalconer on Mon, 23
Feb 2004 17:09:42 GMT)
Subject: Re: Fibonacci number
References: <d7c3a0b2 DOT 0402220759 DOT 34d6435d AT posting DOT google DOT com> <4038E8CA DOT 6491815E AT virginia DOT edu> <4039DD96 DOT 3F36F3B7 AT yahoo DOT com> <200402231458 DOT i1NEwKwm020904 AT envy DOT delorie DOT com> <403A301C DOT E8F5FE65 AT yahoo DOT com>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> That isn't a range error IMO - the initial '-' is an illegal char,
> so it shouldn't convert anything, and should return 0.  From N869:
>
>   [#4] The subject sequence is defined as the longest  initial
>   subsequence  of  the  input  string, starting with the first
>   non-white-space character, that is  of  the  expected  form.

ISO 9899/1999 explicitly allows '-' to be part of the expected form
for strtoul.  Negative numbers are outside its range.

> In either case the 2.03 version of strtoul does NOT return ULONG_MAX
> for -2, it simply performs the usual conversion modulo ULONG_MAX+1.

Ok, *that* is a bug.  Amusingly enough, glibc 2.3.2 has the same bug.

At this point, I think the right next step is to create a test suite
for these functions and post it to djgpp-workers (no need to subject
the regular list with such detail).  Once we agree on what the right
results are, we can proceed with fixing them.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019