This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
GCC2.95.3-libio fails to build
- To: gcc-bugs at gcc dot gnu dot org
- Subject: GCC2.95.3-libio fails to build
- From: "Andreas Wolff" <andreas dot wolff at dusnet dot de>
- Date: 17 Apr 2001 17:57:17 +0200
Hi !
short:
------
package: gcc-2.95.3.tar.gz
platform: m68k-amigaos (GeekGadgets)
error: conflictions types _IO_pos_t & _IOoff_t when building
'libio.a'.
This problem is not specific to this platform, others may be affected
also.
long:
-----
I report this by mail instead via GNATS since my problem is relative
uncommom.
I don't have to report a functional bug. Instead I found a problem in
the sources which may cause the gcc-package build itself to fail on
several platforms.
I found this while porting the actual package (GCC 2.95.3) to the
GeekGadgets project, which is a collection of the gnu-tools for
AmigaOS (m68k, PPC), BeOS (PPC, i586) and more.
Actually I managed to port GCC 2.95.3 to this platform and it works
very finy (thank you for it ...).
But when doing the final build, to be precise when building libio, the
build fails with an error message saying conflicting types:
Some prototype definitions and some function declarations differ in
the baseline archive (_IO_pos_t <-> IOoff_t). I guess someone changed
the proto defs in 'libio.h' & 'libioP.h' and then forgot to update the
related func decls.
I suppose, on most machines these types were mapped to the same
basic-type. This may be why nobody found the problem already.
But when compiling natively with GeekGadgets these types were mapped
to different types (int vs long), so compiling stops with "conflicting
types".
Actually 'int' and 'long' were both 'signed 32bit' for m68k-amigaos,
so code should work though. The only problem is that the compiler
complains about the difference.
You may locate these differences by the diff-file I appended. It
changes all func decl that differ from proto decl needed for a clean
build.
Let me know, if you need any further information ...
Best regards,
Andreas
diff -rup --new-file gcc-2.95.3/libio/fileops.c gcc-2.95.3-bugfixed/libio/fileops.c
--- gcc-2.95.3/libio/fileops.c Mon Apr 12 18:27:49 1999
+++ gcc-2.95.3-bugfixed/libio/fileops.c Thu Apr 5 10:35:36 2001
@@ -419,7 +419,10 @@ _IO_file_sync (fp)
return retval;
}
-_IO_pos_t
+// Changed 2001-04-05 Andreas Wolff <andreas.wolff@dusnet.de>
+// Avoid conflicting types with libioP.h
+// This may be obsolete for future versions of libio
+_IO_off_t
_IO_file_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
@@ -587,7 +590,10 @@ _IO_file_read (fp, buf, size)
return read (fp->_fileno, buf, size);
}
-_IO_pos_t
+// Changed 2001-04-05 Andreas Wolff <andreas.wolff@dusnet.de>
+// Avoid conflicting types with libioP.h
+// This may be obsolete for future versions of libio
+_IO_off_t
_IO_file_seek (fp, offset, dir)
_IO_FILE *fp;
_IO_off_t offset;
diff -rup --new-file gcc-2.95.3/libio/genops.c gcc-2.95.3-bugfixed/libio/genops.c
--- gcc-2.95.3/libio/genops.c Fri Mar 5 00:19:08 1999
+++ gcc-2.95.3-bugfixed/libio/genops.c Thu Apr 5 22:28:19 2001
@@ -467,10 +467,13 @@ _IO_default_setbuf (fp, p, len)
return fp;
}
-_IO_pos_t
+// Changed 2001-04-05 Andreas Wolff <andreas.wolff@dusnet.de>
+// Avoid conflicting types with libioP.h
+// This may be obsolete for future versions of libio
+_IO_off_t
_IO_default_seekpos (fp, pos, mode)
_IO_FILE *fp;
- _IO_pos_t pos;
+ _IO_off_t pos;
int mode;
{
return _IO_SEEKOFF (fp, _IO_pos_as_off (pos), 0, mode);
@@ -551,7 +554,10 @@ _IO_default_finish (fp, dummy)
_IO_un_link (fp);
}
-_IO_pos_t
+// Changed 2001-04-05 Andreas Wolff <andreas.wolff@dusnet.de>
+// Avoid conflicting types with libioP.h
+// This may be obsolete for future versions of libio
+_IO_off_t
_IO_default_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
@@ -882,7 +888,10 @@ _IO_default_pbackfail (fp, c)
return (unsigned char) *fp->_IO_read_ptr;
}
-_IO_pos_t
+// Changed 2001-04-05 Andreas Wolff <andreas.wolff@dusnet.de>
+// Avoid conflicting types with libioP.h
+// This may be obsolete for future versions of libio
+_IO_off_t
_IO_default_seek (fp, offset, dir)
_IO_FILE *fp;
_IO_off_t offset;
diff -rup --new-file gcc-2.95.3/libio/ioseekoff.c gcc-2.95.3-bugfixed/libio/ioseekoff.c
--- gcc-2.95.3/libio/ioseekoff.c Tue Sep 16 16:00:21 1997
+++ gcc-2.95.3-bugfixed/libio/ioseekoff.c Thu Apr 5 10:43:53 2001
@@ -25,7 +25,10 @@
#include <libioP.h>
-_IO_pos_t
+// Changed 2001-04-05 Andreas Wolff <andreas.wolff@dusnet.de>
+// Avoid conflicting types with libioP.h
+// This may be obsolete for future versions of libio
+_IO_off_t
_IO_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;
diff -rup --new-file gcc-2.95.3/libio/ioseekpos.c gcc-2.95.3-bugfixed/libio/ioseekpos.c
--- gcc-2.95.3/libio/ioseekpos.c Tue Sep 16 16:00:23 1997
+++ gcc-2.95.3-bugfixed/libio/ioseekpos.c Thu Apr 5 10:46:18 2001
@@ -25,10 +25,13 @@
#include <libioP.h>
-_IO_pos_t
+// Changed 2001-04-05 Andreas Wolff <andreas.wolff@dusnet.de>
+// Avoid conflicting types with libioP.h
+// This may be obsolete for future versions of libio
+_IO_off_t
_IO_seekpos (fp, pos, mode)
_IO_FILE *fp;
- _IO_pos_t pos;
+ _IO_off_t pos;
int mode;
{
_IO_pos_t retval;
diff -rup --new-file gcc-2.95.3/libio/strops.c gcc-2.95.3-bugfixed/libio/strops.c
--- gcc-2.95.3/libio/strops.c Fri May 22 20:40:02 1998
+++ gcc-2.95.3-bugfixed/libio/strops.c Thu Apr 5 10:48:49 2001
@@ -205,7 +205,10 @@ _IO_str_count (fp)
- fp->_IO_read_base);
}
-_IO_pos_t
+// Changed 2001-04-05 Andreas Wolff <andreas.wolff@dusnet.de>
+// Avoid conflicting types with libioP.h
+// This may be obsolete for future versions of libio
+_IO_off_t
_IO_str_seekoff (fp, offset, dir, mode)
_IO_FILE *fp;
_IO_off_t offset;