2 ms·
John Regehr wrote a post about checking for signed overflow a few years ago: https://blog.regehr.org/archives/1139 https://blog.regehr.org/archives/1139 HN di
by SloopJon 8y ago
John Regehr wrote a post about checking for signed overflow a few years ago:
https://blog.regehr.org/archives/1139 https://blog.regehr.org/archives/1139
HN discussion:
https://news.ycombinator.com/item?id=7665254 https://news.ycombinator.com/item?id=7665254
Your first suggestion is similar to his checked_add_1(). The Emacs macros are similar to his checked_add_4(). Presumably builtins are optimal, performance wise, for a given compiler.