public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13682] New: Compile error with cstdio: fgetpos not declared on AIX
@ 2004-01-14 15:54 richard_wheeler at cinfin dot com
  2004-01-14 15:56 ` [Bug c++/13682] " richard_wheeler at cinfin dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: richard_wheeler at cinfin dot com @ 2004-01-14 15:54 UTC (permalink / raw)
  To: gcc-bugs

Attempting to compile C++ module from Berkeley-db 4.2.52 that gets the 
following error.  I do not understand why it is having a finding the standard 
library functions.  I am hoping someone here could point me the right way.

Thanks

Output is below:

g++ -v -save-temps -c -I. -I../dist/.. -D_THREAD_SAFE -
O2 ../dist/../cxx/cxx_db.cpp  -DPIC -o .libs/cxx_db.o

Reading specs from /cmDevTest/Dev/local/bin/../lib/gcc-lib/powerpc-ibm-
aix5.2.0.0/3.3.2/specs
Configured with: ../gcc-3.3.2/configure --prefix=/cmDevTest/local --enable-
shared --enable-thread
s=aix
Thread model: aix
gcc version 3.3.2
 /cmDevTest/Dev/local/bin/../lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/cc1plus -
E -D__GNUG__=3 -qu
iet -v -I. -I../dist/.. -iprefix /cmDevTest/Dev/local/bin/../lib/gcc-
lib/powerpc-ibm-aix5.2.0.0/3
.3.2/ -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2 -
D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE
_EXTENDED=1 -D_LARGE_FILE_API -D_ALL_SOURCE -D_THREAD_SAFE -
DPIC ../dist/../cxx/cxx_db.cpp -O2 cx
x_db.ii
ignoring nonexistent directory "/cmDevTest/Dev/local/bin/../powerpc-ibm-
aix5.2.0.0/include"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/cmDevTest/local/powerpc-ibm-aix5.2.0.0/include"
ignoring duplicate directory "/cmDevTest/local/include/c++/3.3.2"
ignoring duplicate directory "/cmDevTest/local/include/c++/3.3.2/powerpc-ibm-
aix5.2.0.0"
ignoring duplicate directory "/cmDevTest/local/include/c++/3.3.2/backward"
ignoring duplicate directory "/cmDevTest/local/lib/gcc-lib/powerpc-ibm-
aix5.2.0.0/3.3.2/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 ..
 /cmDevTest/Dev/local/bin/../include/c++/3.3.2
 /cmDevTest/Dev/local/bin/../include/c++/3.3.2/powerpc-ibm-aix5.2.0.0
 /cmDevTest/Dev/local/bin/../include/c++/3.3.2/backward
 /cmDevTest/Dev/local/bin/../lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include
 /cmDevTest/local/include
 /usr/include
End of search list.
 /cmDevTest/Dev/local/bin/../lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/cc1plus -
fpreprocessed cxx_
db.ii -quiet -dumpbase cxx_db.cpp -auxbase-strip .libs/cxx_db.o -O2 -version -o 
cxx_db.s
GNU C++ version 3.3.2 (powerpc-ibm-aix5.2.0.0)
        compiled by GNU C version 3.3.2.
GGC heuristics: --param ggc-min-expand=32 --param ggc-min-heapsize=4096
In file included from /cmDevTest/Dev/local/bin/../include/c++/3.3.2/powerpc-ibm-
aix5.2.0.0/bits/c
++io.h:35,
                 
from /cmDevTest/Dev/local/bin/../include/c++/3.3.2/bits/fpos.h:44,
                 from /cmDevTest/Dev/local/bin/../include/c++/3.3.2/iosfwd:49,
                 from /cmDevTest/Dev/local/bin/../include/c++/3.3.2/ios:44,
                 from /cmDevTest/Dev/local/bin/../include/c++/3.3.2/ostream:45,
                 from /cmDevTest/Dev/local/bin/../include/c++/3.3.2/iostream:45,
                 from db_cxx.h:56,
                 from ../cxx/cxx_db.cpp:17:
/cmDevTest/Dev/local/bin/../include/c++/3.3.2/cstdio:108: error: `fgetpos' not
   declared
/cmDevTest/Dev/local/bin/../include/c++/3.3.2/cstdio:110: error: `fopen' not
   declared
/cmDevTest/Dev/local/bin/../include/c++/3.3.2/cstdio:115: error: `freopen' not
   declared
/cmDevTest/Dev/local/bin/../include/c++/3.3.2/cstdio:118: error: `fsetpos' not
   declared

-- 
           Summary: Compile error with cstdio: fgetpos not declared on AIX
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: richard_wheeler at cinfin dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: 3.3.2
  GCC host triplet: AIX 5.2
GCC target triplet: AIX 5.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13682


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
  2004-01-14 15:54 [Bug c++/13682] New: Compile error with cstdio: fgetpos not declared on AIX 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; 10+ 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] 10+ messages in thread

* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
  2004-01-14 15:54 [Bug c++/13682] New: Compile error with cstdio: fgetpos not declared on AIX 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; 10+ 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] 10+ messages in thread

* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
  2004-01-14 15:54 [Bug c++/13682] New: Compile error with cstdio: fgetpos not declared on AIX 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; 10+ 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] 10+ messages in thread

* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
  2004-01-14 15:54 [Bug c++/13682] New: Compile error with cstdio: fgetpos not declared on AIX 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; 10+ 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] 10+ messages in thread

* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
  2004-01-14 15:54 [Bug c++/13682] New: Compile error with cstdio: fgetpos not declared on AIX 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; 10+ 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] 10+ messages in thread

* [Bug c++/13682] Compile error with cstdio: fgetpos not declared on AIX
  2004-01-14 15:54 [Bug c++/13682] New: Compile error with cstdio: fgetpos not declared on AIX 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; 10+ 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] 10+ 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 ` 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; 10+ 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] 10+ 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 ` 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; 10+ 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] 10+ 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 ` 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; 10+ 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] 10+ messages in thread

end of thread, other threads:[~2010-05-17 20:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-14 15:54 [Bug c++/13682] New: Compile error with cstdio: fgetpos not declared on AIX 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
     [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

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).