4 ms·
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 alw
by mikeash 14y ago
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....
- regularfry 14y agoGot it in one :-)
- nitrogen 14y agoC 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.
- mikeash 14y agoSadly, a lot of people have never learned this valuable lesson, and happily build their code with hundreds or even thousands of warnings.