This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch draft] Fix libstdc++/8610
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Tue, 21 Oct 2003 09:56:28 -0500
- Subject: Re: [Patch draft] Fix libstdc++/8610
- Organization: Red Hat / Chicago
- References: <3F945B7B.8000305@suse.de>
>So, here comes my first draft. Everything seems to work :), but I
>encourage your feedback for refining it. For instance, perhaps I'm
>being naive in checking if a value passed to 'lseek' doesn't
>overflow off_t like this:
>
> if (__off != static_cast<off_t>(__off))
>
>???
>It works, but probably we can do better...
Yeah. No ideas on this, however. Maybe
numeric_limits<off_t>::max()?
>Also, is it safe to assume that a libc making available lseek64
>does also provide fopen64?
Not really. You should check for this as well. I suggest also, instead
of keying off of HAVE_INT64_T, HAVE_LSEEK64 that you check for all this
stuff in much the same way that _GLIBCXX_USE_WCHAR_T operates.
Ie, in configure test for int64_t, lseek64, fopen64 and if they all succeed define
_GLIBCXX_USE_LFS 1
And then use this macro in the source files.
best,
benjamin