Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
SjuulJanssen
· 14y ago · 0 comments
"A recommended use of assertions is to follow the following pattern:" if (!c_assert(p >= 0) == true) { return ERROR; }
Why not: if (!c_assert(p >= 0)) { return ERROR; }
Comments
[–]
vbtemp
14y ago
Because the whole point is to be maximally explicit and not implicit.
[–]
jbester
14y ago
It's one of the MISRA rules - implicit comparisons aren't allowed.