tl;dr
#include <stdckdint.h>
bool ckd_add(type1 *result, type2 a, type3 b);
bool ckd_sub(type1 *result, type2 a, type3 b);
bool ckd_mul(type1 *result, type2 a, type3 b);
#include <stdckdint.h>
#include <limits.h>
/* ... */
int x;
int a = INT_MAX;
int b = INT_MAX;
if (!chk_add(&x, a, b)) {
/* error! */
}
Other stuff on the table for C23- https://thephd.dev/c-the-improvements-june-september-virtual...
- (PDF) https://open-std.org/jtc1/sc22/wg14/www/docs/n3054.pdf