From: Paolo Teti Date: Fri, 18 May 2007 15:08:02 GMT Subject: Re: git-rebase (1.5.0.6) errors Message-ID: <34a7ae040705180808t1eebd9f0p5a4046d7b281c56e@mail.gmail.com> In-Reply-To: <864pmamb6b.fsf@lola.quinscape.zz> 2007/5/18, David Kastrup : > "Paolo Teti" writes: > > > 2007/5/18, Ilpo Järvinen : > > > >> ...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