From: heretic AT polbox DOT com Message-Id: <199707161302.PAA20053@free.polbox.pl> Comments: Authenticated sender is To: djgpp AT delorie DOT com Date: Wed, 16 Jul 1997 15:05:33 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: fread/fwite return value Precedence: bulk hi there I've noticed a kind of anomaly while writing a program using fwrite/fread functions. First take a look at library reference: size_t fread(void *_ptr, size_t _size, size_t _nelem, FILE *_stream); (...) Return value ============ The number of items of size SIZE read, or -1 on error. 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? --------------------------------------- With heretic's greeting http://www.polbox.com/h/heretic ---------------------------------------