Re: [PATCH] tests: fix signed overflow issues

2021-03-21 Thread Bruno Haible
> * tests/test-dynarray.c (value_at): Avoid undefined behavior > in signed integer multiplication. Thanks. Indeed with N=10 the multiplication would overflow. If I had used CC="gcc -ftrapv", I would have noticed. Bruno

[PATCH] tests: fix signed overflow issues

2021-03-21 Thread Paul Eggert
* tests/test-dynarray.c (value_at): Avoid undefined behavior in signed integer multiplication. * tests/test-scratch-buffer.c (byte_at): Likewise, for the theoretically-possible case where size_t is narrower than int. --- ChangeLog | 8 tests/test-dynarray.c | 2 +-