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

It works for == -1, but not for < 0, which is a common way to check for error returns from UNIX calls.

Any decent compiler should warn that such a check is always false, but people don't always pay attention to that stuff....



C is my absolute favorite language, and as such, I learned a long time ago to pay very close attention to compiler warnings and Valgrind memory errors.


Sadly, a lot of people have never learned this valuable lesson, and happily build their code with hundreds or even thousands of warnings.


Got it in one :-)




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: