public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
[not found] <bug-13682-7634@http.gcc.gnu.org/bugzilla/>
@ 2008-06-03 18:20 ` patrick133t at yahoo dot com
2009-08-20 7:31 ` oliver at FreeBSD dot org
2010-05-17 20:06 ` pedzsan at gmail dot com
2 siblings, 0 replies; 9+ messages in thread
From: patrick133t at yahoo dot com @ 2008-06-03 18:20 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
[not found] <bug-13682-7634@http.gcc.gnu.org/bugzilla/>
2008-06-03 18:20 ` [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX patrick133t at yahoo dot com
@ 2009-08-20 7:31 ` oliver at FreeBSD dot org
2010-05-17 20:06 ` pedzsan at gmail dot com
2 siblings, 0 replies; 9+ messages in thread
From: oliver at FreeBSD dot org @ 2009-08-20 7:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from oliver at FreeBSD dot org 2009-08-20 07:31 -------
I fixed this on my AIX system by changing
/opt/pkg/gcc34/include/c++/3.4.6/cstdio.
I uncommented the undef's:
<snip>
// Get rid of those macros defined in <stdio.h> in lieu of real functions.
#undef clearerr
#undef fclose
#undef feof
#undef ferror
#undef fflush
#undef fgetc
/* get db4 to compile #undef fgetpos */
#undef fgets
/* get db4 to compile #undef fopen */
#undef fprintf
#undef fputc
#undef fputs
#undef fread
/* get db4 to compile #undef freopen */
#undef fscanf
#undef fseek
/* get db4 to compile #undef fsetpos */
#undef ftell
#undef fwrite
</snip>
This made db4 compile..... So I guess this is of course a gcc problem because
this headers are supplied by gcc!
As in #7 stated, on AIX the functions are redefined to use the 64-Bit functions
for large-file support. #undef'ing them later removes the definition to the
64-Bit functions but only them are declared on aix when large file support is
defined.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
[not found] <bug-13682-7634@http.gcc.gnu.org/bugzilla/>
2008-06-03 18:20 ` [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX patrick133t at yahoo dot com
2009-08-20 7:31 ` oliver at FreeBSD dot org
@ 2010-05-17 20:06 ` pedzsan at gmail dot com
2 siblings, 0 replies; 9+ messages in thread
From: pedzsan at gmail dot com @ 2010-05-17 20:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pedzsan at gmail dot com 2010-05-17 20:05 -------
The general reply to this was "your GCC was not compiled for your system".
That isn't the case. I have two compiles on two different systems. One if
version 4.5.0 and the other version is 4.3.1 compiled on AIX 5.3 TL05 CSP. The
4.5.0 version I just finished compiling and it still has the problem.
--
pedzsan at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pedzsan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
2004-01-14 15:54 [Bug c++/13682] New: " richard_wheeler at cinfin dot com
` (4 preceding siblings ...)
2004-01-14 19:30 ` pinskia at gcc dot gnu dot org
@ 2004-01-14 19:41 ` richard_wheeler at cinfin dot com
5 siblings, 0 replies; 9+ messages in thread
From: richard_wheeler at cinfin dot com @ 2004-01-14 19:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From richard_wheeler at cinfin dot com 2004-01-14 19:41 -------
(In reply to comment #5)
> Because it looks like one of your header file somewhere either in installed
by gcc or your system
> header files is changing the definition. Still not a GCC problem, try to make
sure that all of system
> header files are uptodate. And then reinstall GCC.
Are you saying that the line in the .ii file is not the actual header file
being used by GCC?
> # 295 "/cmDevTest/Dev/local/bin/../lib/gcc-lib/powerpc-ibm-
aix5.2.0.0/3.3.2/include/stdio.h" 2 3 4
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
2004-01-14 15:54 [Bug c++/13682] New: " richard_wheeler at cinfin dot com
` (3 preceding siblings ...)
2004-01-14 19:26 ` richard_wheeler at cinfin dot com
@ 2004-01-14 19:30 ` pinskia at gcc dot gnu dot org
2004-01-14 19:41 ` richard_wheeler at cinfin dot com
5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-14 19:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-14 19:30 -------
Because it looks like one of your header file somewhere either in installed by gcc or your system
header files is changing the definition. Still not a GCC problem, try to make sure that all of system
header files are uptodate. And then reinstall GCC.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
2004-01-14 15:54 [Bug c++/13682] New: " richard_wheeler at cinfin dot com
` (2 preceding siblings ...)
2004-01-14 19:22 ` richard_wheeler at cinfin dot com
@ 2004-01-14 19:26 ` richard_wheeler at cinfin dot com
2004-01-14 19:30 ` pinskia at gcc dot gnu dot org
2004-01-14 19:41 ` richard_wheeler at cinfin dot com
5 siblings, 0 replies; 9+ messages in thread
From: richard_wheeler at cinfin dot com @ 2004-01-14 19:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From richard_wheeler at cinfin dot com 2004-01-14 19:26 -------
Created an attachment (id=5488)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5488&action=view)
lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/stdio.h
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
2004-01-14 15:54 [Bug c++/13682] New: " richard_wheeler at cinfin dot com
2004-01-14 15:56 ` [Bug c++/13682] " richard_wheeler at cinfin dot com
2004-01-14 17:43 ` pinskia at gcc dot gnu dot org
@ 2004-01-14 19:22 ` richard_wheeler at cinfin dot com
2004-01-14 19:26 ` richard_wheeler at cinfin dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: richard_wheeler at cinfin dot com @ 2004-01-14 19:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From richard_wheeler at cinfin dot com 2004-01-14 19:22 -------
(In reply to comment #2)
> Not a bug, looks like you GCC is not really compiled for you OS version.
> In the preprocessed file, I see:
> # 295 "/cmDevTest/Dev/local/bin/../lib/gcc-lib/powerpc-ibm-
aix5.2.0.0/3.3.2/include/stdio.h" 2
> 3 4
> .......
> extern int fgetpos64(FILE *, fpos_t *);
> .......
> # 492 "/cmDevTest/Dev/local/bin/../lib/gcc-lib/powerpc-ibm-
aix5.2.0.0/3.3.2/include/stdio.h" 3
> 4
> extern int fgetpos64(FILE *, fpos64_t *);
> ......
> using :: fgetpos
Why did the compiler did not pick up the actual entries in stdio.h? I attached
the file referenced. It shows the following at that position in the file:
extern int fgetpos(FILE *__restrict__, fpos_t *__restrict__);
extern int fseek(FILE *, long int, int);
extern int fsetpos(FILE *, const fpos_t *);
extern long ftell(FILE *);
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
2004-01-14 15:54 [Bug c++/13682] New: " richard_wheeler at cinfin dot com
2004-01-14 15:56 ` [Bug c++/13682] " richard_wheeler at cinfin dot com
@ 2004-01-14 17:43 ` pinskia at gcc dot gnu dot org
2004-01-14 19:22 ` richard_wheeler at cinfin dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-14 17:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-14 17:43 -------
Not a bug, looks like you GCC is not really compiled for you OS version.
In the preprocessed file, I see:
# 295 "/cmDevTest/Dev/local/bin/../lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/stdio.h" 2
3 4
.......
extern int fgetpos64(FILE *, fpos_t *);
.......
# 492 "/cmDevTest/Dev/local/bin/../lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/stdio.h" 3
4
extern int fgetpos64(FILE *, fpos64_t *);
......
using :: fgetpos
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
2004-01-14 15:54 [Bug c++/13682] New: " richard_wheeler at cinfin dot com
@ 2004-01-14 15:56 ` richard_wheeler at cinfin dot com
2004-01-14 17:43 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: richard_wheeler at cinfin dot com @ 2004-01-14 15:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From richard_wheeler at cinfin dot com 2004-01-14 15:56 -------
Created an attachment (id=5481)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5481&action=view)
>From Berkeley DB 4.2.52 cxx/cxx_db.cpp
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-05-17 20:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-13682-7634@http.gcc.gnu.org/bugzilla/>
2008-06-03 18:20 ` [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX patrick133t at yahoo dot com
2009-08-20 7:31 ` oliver at FreeBSD dot org
2010-05-17 20:06 ` pedzsan at gmail dot com
2004-01-14 15:54 [Bug c++/13682] New: " richard_wheeler at cinfin dot com
2004-01-14 15:56 ` [Bug c++/13682] " richard_wheeler at cinfin dot com
2004-01-14 17:43 ` pinskia at gcc dot gnu dot org
2004-01-14 19:22 ` richard_wheeler at cinfin dot com
2004-01-14 19:26 ` richard_wheeler at cinfin dot com
2004-01-14 19:30 ` pinskia at gcc dot gnu dot org
2004-01-14 19:41 ` richard_wheeler at cinfin dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).