This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/5627: cstdio header failes to compile on sparc-sun-solaris2.7 with _FILE_OFFSET_BITS == 64
- From: paulf at sea dot checkpoint dot com
- To: gcc-gnats at gcc dot gnu dot org
- Cc: marka at sea dot checkpoint dot com
- Date: 7 Feb 2002 21:06:31 -0000
- Subject: libstdc++/5627: cstdio header failes to compile on sparc-sun-solaris2.7 with _FILE_OFFSET_BITS == 64
- Reply-to: paulf at sea dot checkpoint dot com
>Number: 5627
>Category: libstdc++
>Synopsis: cstdio header failes to compile on sparc-sun-solaris2.7 with _FILE_OFFSET_BITS == 64
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Feb 07 13:16:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Paul Forgey
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
sparc-sun-solaris2.7
>Description:
when _FILE_OFFSET_BITS is set to `64', the system's stdio.h will actually make the symbols fopen, freopen, tmpfile, fgetpos and fsetpos unavailable at all, even as normal function definitions, if they are #undef'd. This causes the later part of the header file pulling these into namespace std to fail with complaints these symbols are undefined.
>How-To-Repeat:
attempt to build Berkeley db-3.3.11 after passing --enable-cxx to the configure script.
>Fix:
This is probably not the best fix, but it got me past the issue. Somebody who knows their way around the solaris headers better than I do could probably come up with a more "real" fix:
in $prefix/include/g++-v3/bits/std_cstdio.h, remove the #undef macros for these symbols, and add the following code at line 43 (right after #include <stdio.h>):
// The following functions _can not_ be #undef'd if we are using 64
// bit file pointers
#if ! (defined (sun) && !defined (_LP64) && _FILE_OFFSET_BITS == 64)
#undef fopen
#undef freopen
#undef tmpfile
#undef fgetpos
#undef fsetpos
#endif // whew
>Release-Note:
>Audit-Trail:
>Unformatted: