News for hackers. Stuff that matters.
Re:Checked integer arithmetic in the prospect of C23 by dooglius on Monday December 19, 2022 @12:18PM (#34054661)
I find the most readable, unambiguous thing is to define explicit macros or constants, e.g.

  if(ckd_add(&result_add, a, b) == CKD_SUCCESS) { ... }
or alternatively,

  if(CKD_SUCCESS(ckd_add(&result_add, a, b))) { ... }
Re:Checked integer arithmetic in the prospect of C23 by kevin_thibedeau on Monday December 19, 2022 @04:17PM (#34057838)
The return value is the overflow condition so just name it CKD_OVERFLOW.