Protip:<os/overflow.h> to avoid under/over/undef behavior, eg: if(os_add_overflow(a, b, &res)) { //Try again Ian }. (add/sub/mul variants)
Not a fan of using weird non-portable intrinsics for this when there are standard idioms the compiler should optimize for checking overflow.
-
-
I wish there was a better story, yet the fountain of security vulnerabilities overfloweth
-
Yes. Either way ppl have to fix their code/do better writing new code. But they can do it in a clean & portable way rather than intrinsics.
End of conversation
New conversation -
-
-
Of course in my uninformed opinion C should have a stds-compliant mode that does array bounds checking so you may not want to listen to me.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
An idiom that you have to write yourself is yet another place to get it wrong. The implementation could be a normal function, though.
-
(yes, it's actually N normal functions, but _Generic exists now)
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.