C23 adds a set of macros for doing checked addition, multiplication, and subtraction
They write the result to a pointer and returns false if the value written is correct (ie didn't overflow)

They return
false
to indicate
success

Follow

@amy This somewhat makes sense:

0==false, by the Anna Karenina principle one should return 0
Every other number designates a failure state, I guess?

2nd original sin in computing was 1==true 1==false

Sign in to participate in the conversation
Mastodon

a Schelling point for those who seek one