This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
- From: "patrick133t at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jun 2008 18:19:52 -0000
- Subject: [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
- References: <bug-13682-7634@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from patrick133t at yahoo dot com 2008-06-03 18:19 -------
I see this on AIX 5.3 also. I tracked it down by creating a simple program that
just does a #include <string> and then saw that it worked when compiled as:
g++ -c -o bar.o bar.cc
However, it fails to compile when I do
g++ -c -D_LARGE_FILES -o bar.o bar.cc
I then grepped all the files that get included in the preprocessed output and
found only these two reference _LARGE_FILES:
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.2/include/stdio.h
/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.2/include/sys/types.h
The problem appears to be that stdio.h makes the following definitions that
then get #undef'ed in cstdio:
#define fseeko fseeko64
#define ftello ftello64
#define fgetpos fgetpos64
#define fsetpos fsetpos64
#define fopen fopen64
#define freopen freopen64
Because of these defitions, the prototypes in the preprocessed output have a 64
on the end but the using ::fsetpos do not have them, and we get the error.
I really think this is GCC's problem and not caused by AIX headers.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682