Re: [PATCH 4/6] tools/nolibc: fix integer overflow in i{64,}toa_r() and

2025-04-19 Thread Thomas Weißschuh
On 2025-04-19 11:40:08+0200, Willy Tarreau wrote: > On Wed, Apr 16, 2025 at 08:40:19PM +0200, Thomas Weißschuh wrote: > > In twos complement the most negative number can not be negated. > > well, if we're picky, that's not really an int overflow since it's only > used as an unsigned in the end, so

Re: [PATCH 4/6] tools/nolibc: fix integer overflow in i{64,}toa_r() and

2025-04-19 Thread Willy Tarreau
On Wed, Apr 16, 2025 at 08:40:19PM +0200, Thomas Weißschuh wrote: > In twos complement the most negative number can not be negated. well, if we're picky, that's not really an int overflow since it's only used as an unsigned in the end, so -2^(N-1) == 2^(N-1) in twos complement. > @@ -271,16 +271,

[PATCH 4/6] tools/nolibc: fix integer overflow in i{64,}toa_r() and

2025-04-16 Thread Thomas Weißschuh
In twos complement the most negative number can not be negated. Fixes: b1c21e7d99cd ("tools/nolibc/stdlib: add i64toa() and u64toa()") Fixes: 66c397c4d2e1 ("tools/nolibc/stdlib: replace the ltoa() function with more efficient ones") Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/stdli