Mail Archives: djgpp/2004/02/23/12:51:44
> 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 -