From: eyal DOT ben-david AT aks DOT com To: heretic AT polbox DOT com cc: djgpp AT delorie DOT com Message-ID: <422564D6.005C61DE.00@aks.com> Date: Wed, 16 Jul 1997 18:54:27 +0200 Subject: Re: fread/fwite return value Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Precedence: bulk On 7/16/97 6:05:33 PM heretic wrote: >So, I wanted to have error checking and I wrote something like > > if ( fread(blah,blah,blah) == -1 ) > { > oh_no_error (); > } > >But compiler warned that I am comparing unsigned and signed. And it >was right: size_t is unsigned long! Anyone knows how fread or fwrite >can return -1 on error while its return value is unsigned? > cast . now it is 0xFFFFFFFF. if (fread (...) == (size_t) -1) { ..... } Eyal.