This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libio compilation problem


The following errors occur compiling libio/genops.c under vax-ultrix:

/usr/local/src/gnu/gcc-2.96/objdir/gcc/xgcc -B/usr/local/src/gnu/gcc-2.96/objdir
/gcc/ -B/usr/local/vax-dec-ultrix4.3/bin/ -c -O3 -I. -I../../../libio  ../../../
libio/genops.c
../../../libio/genops.c:472: conflicting types for `_IO_default_seekpos'
../../../libio/libioP.h:349: previous declaration of `_IO_default_seekpos'
../../../libio/genops.c:556: conflicting types for `_IO_default_seekoff'
../../../libio/libioP.h:348: previous declaration of `_IO_default_seekoff'
../../../libio/genops.c:887: conflicting types for `_IO_default_seek'
../../../libio/libioP.h:358: previous declaration of `_IO_default_seek'
make[2]: *** [genops.o] Error 1
make[2]: Leaving directory `/usr/local/src/gnu/gcc-2.96/objdir/vax-dec-ultrix4.3/libio'
make[1]: *** [all-target-libio] Error 2

There are a couple of problems here:

1) There is a prototype mismatch between libioP.h and genops.c for the above
   routines.  For example,

libioP:
extern _IO_off_t _IO_default_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));

genops.c:
_IO_pos_t
_IO_default_seekpos (fp, pos, mode)
     _IO_FILE *fp;
     _IO_pos_t pos;
     int mode;

libio.h:
#define _IO_pos_t _G_fpos_t /* obsolete */
#define _IO_off_t _G_off_t

Shouldn't genops.c be changed to make the protypes in it compatible with
those in libioP.h?

2) The defines for _G_fpos_t and _G_off_t in _G_config.h are long and int,
   respectively.  On the VAX, these are equivalent.  Thus, are the types
   really conflicting?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]