Idiom exclusion is really so important
Idiom exclusion is really so important
Posted Nov 27, 2024 23:58 UTC (Wed) by jwakely (subscriber, #60262)In reply to: Idiom exclusion is really so important by adobriyan
Parent article: Progress on toolchain security features
>The _right_ way is to not invent new idioms (which every project will do differently) but to use __builtin_add_overflow().
It's in C23 as chk_add so instead of inventing your own, write chk_add as a simple wrapper around bao and then everybody agrees on a standard API.
N.B. chk_add has the output pointer first, not last. Otherwise it's the same.
