This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch draft] Fix libstdc++/8610


>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]