add_of3
Add two integers, check for arithmetic overflow
Usage
#include <libowfat/rangecheck.h>
int add_of(dest,a,b);
Overview
If calculating a+b is possible without causing undefined behavior or an arithmetic overflow in C, and the sum fits into the destination integer type, do dest=a+b and return 0.
Otherwise, return 1.
Note: This is a macro, so dest does not have to be a pointer.
Releases
Unchanged in 2 releases since Debian 12 (Bookworm).