|
From: | Matthew Woehlke |
Subject: | Re: FYI: portability tweak for Tru64 V4.0. |
Date: | Wed, 25 Oct 2006 14:29:10 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.0 |
Paul Eggert wrote:
Jim Meyering <address@hidden> 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.
Too late, Windows is one. I *so* want to kill someone for actually having the gall to create a P64 (as opposed to LP64) platform.
But Tru64 is not, sizeof(long int) == 8. -- Matthew When on POSIX, do as POSIX mandates.
[Prev in Thread] | Current Thread | [Next in Thread] |