Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> if (!chk_add(&x, a, b)) { > /* error! */ > }

does it return non-zero on success???



They're using a bool, so it violates the old-school C paradigm used for library calls. This is more of a macro rather than a syscall or standard library function call.


It returns a bool, but true means error, not false.


It's not really an error. The function is just "check if this addition overflows" and tells you true, it does overflow, or false, it doesn't.


It returns a boolean.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: