Jim Meyering <[EMAIL PROTECTED]> writes:

> +static inline off_t ftello (FILE *stream)
> +{
> +  off_t off = ftell (stream);
> +  if (off < 0)
> +    return off;
> +  if (off != (long int) off)
> +    {
> +      errno = EOVERFLOW;
> +      return -1;
> +    }
> +  return off;
> +}

Something's odd here.  ftell returns long int, so the ftello
substitute needs to worry about overflow only on hosts where long int
is wider than off_t.  But I don't know of any such hosts and don't
expect that there will ever be any.  Surely on Tru64 both types are
64-bit.

How about this alternative instead?

static inline off_t
ftello (FILE *stream)
{
  return ftell (stream);
}


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to