1 post tagged #stdckdint.
#stdckdint
INT_MAX + 1 and x / 0 are undefined for int, and the tools that remove the undefined behavior apply three different policies: std::saturating_add clamps the result, ckd_add reports and leaves the decision to the caller, and -ftrapv or UBSan with -fsanitize-trap stops the program. A table of what each does on GCC 16.2, with the exact diagnostics, including the build where -ftrapv does not trap.
// We use Google Analytics to understand which posts get traction and how the wro.cpp community grows. Anonymised, no ads, and you can decline -- the site works either way.