2007/5/18, David Kastrup <dak@xxxxxxx>:
"Paolo Teti" <paolo.teti@xxxxxxxxx> writes: > 2007/5/18, Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxx>: > >> ...sizeof(size_t) == sizeof(int) should hold... > > what I have reported is not necessarily the cause of your error. Yes > > BUT size_t is UNSIGNED and ssize_t is SIGNED. > > The problem is that We store a signed return value into a unsigned variable. > So the check against -1 has no sense. When comparing signed with unsigned types, the signed values are first converted to unsigned, then possibly zero-extended. So (unsigned)-1 == (int)-1 but (unsigned long)-1 == (long)-1 only when sizeof(long)==size(int) > and please note that also sizeof(int) == sizeof(unsigned int), but > -1 is a signed int !! So?
Stupid me.. OK is == -1 and not < 0.. Probably today I'm drunk without drink .. Enjoy - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html