On 11/25/21 15:34, Laszlo Ersek wrote:
The second patch is the relevant one; the first patch is just a
small
tweak to an existent ADD_OVERFLOW() invocation in
"common/utils/vector.c" -- because we'll need to pass unsigned arguments
to ADD_OVERFLOW() (and MUL_OVERFLOW()) going forward.
Thanks,
Laszlo
Laszlo Ersek (2):
utils/vector: pass only unsigned arguments to (ADD|MUL)_OVERFLOW
common/include/checked-overflow: provide fallback
common/include/checked-overflow.h | 160 ++++++++++++++++++++++--
common/utils/Makefile.am | 8 +-
common/utils/test-checked-overflow.c | 177 +++++++++++++++++++++++++++
common/utils/vector.c | 2 +-
configure.ac | 6 +
5 files changed, 338 insertions(+), 15 deletions(-)
create mode 100644 common/utils/test-checked-overflow.c
base-commit: b9a2c12da886decf662f4e2bbcd1699a200676aa
Sigh, ignore this. I'll send v2 soon. The issue in this version that my
OCaml studies have (apparently) confused me about "=" vs. "==", and
now
I've done the unthinkable in this series, in some asserts :(
(I used to prefer Yoda conditionals, that is (2 == a) rather than (a ==
2), because the former turns (2 = a) into a compilation failure. But
most developers dislike Yoda conditionals, so I stopped using them.)
Sorry,
Laszlo