64 bit coding

Russ Allbery rra at stanford.edu
Wed Apr 25 21:06:23 UTC 2001


bill davidsen <davidsen at tmr.com> writes:
> Russ Allbery  <rra at stanford.edu> wrote:

> | I can't read this error message; it seems to be complaining about:
> | 
> |         fgets(t, F->sbuf - strlen (F->buf), F->f);
> | 
> | but I don't know what it thinks is wrong with that.

>   Sorry for two replies to one message, but I think this is because it
> uses the IBM header files, and this is declared:
>   /usr/include/stdio.h:extern char        *fgets(char *, int, FILE *);
> which might force some conversion.

Ah, yeah.  It's passing a ptrdiff_t to a function that takes an int.  This
is a place where I'd use a cast, since one actually *is* going from a
larger data type to a smaller data type; it's just that in this case we
know that it's okay, and putting in the explicit cast is a good way to
signify that.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>


More information about the inn-workers mailing list