Re: strtoi(3) ERANGE vs ENOTSUP

2024-01-21 Thread Edgar Fuß
I think it depends on what you consider valid use cases of strtoi(). > This is the case when the number is out of range, and there's trailing > garbage -- e.g., s="42z", min=3, max=7. Is it correct to consider the first non-digit character garbage? I.e., would you regard it as an abuse of

Re: strtoi(3) ERANGE vs ENOTSUP

2024-01-20 Thread Alejandro Colomar
Hello Taylor, On Sat, Jan 20, 2024 at 07:07:57PM +, Taylor R Campbell wrote: > PR lib/57828 (https://gnats.NetBSD.org/57828) proposes changing an > edge case of the strtoi(3) function so that if ERANGE and ENOTSUP are > both applicable then it should fail with ERANGE rather than ENOTSUP. > >

Re: strtoi(3) ERANGE vs ENOTSUP

2024-01-20 Thread Mouse
> PR lib/57828 (https://gnats.NetBSD.org/57828) proposes changing an > edge case of the strtoi(3) function so that if ERANGE and ENOTSUP are > both applicable then it should fail with ERANGE rather than ENOTSUP. Has it ever been part of strtoi's contract which error it fails with if multiple

strtoi(3) ERANGE vs ENOTSUP

2024-01-20 Thread Taylor R Campbell
PR lib/57828 (https://gnats.NetBSD.org/57828) proposes changing an edge case of the strtoi(3) function so that if ERANGE and ENOTSUP are both applicable then it should fail with ERANGE rather than ENOTSUP. This is the case when the number is out of range, and there's trailing garbage -- e.g.,