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

I am on split here. Signed overflow is UB and it is pretty well known, yet author is writing code that depends on such overflow.

But is there are a reason for `i >= 0` not raising a warning if it can't happen? Or is there a warning that was not enabled? I think `i >= 0 cant be false` would save a lot of headache

edit: one post mentions macros. Which makes sense in that case I think. You can easily write such impossible conditions with macros, so making it a warning would add a lot of warnings I guess

Although there are warnings for `if (true)/if (false)` "this condition is always true/false"



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

Search: