On Sun, Jan 28, 2007 at 07:23:04PM +0000, Thorsten Glaser wrote: > This version was uploaded to 'experimental' exactly to find out > possibly portability problems, e.g. with kfreebsd and hurd ;) > So I suppose that was a good move. > > Martin Zobel-Helas dixit: > > >> /usr/include/sys/stat.h:217: error: conflicting types for 'stat' > >> /usr/include/sys/stat.h:365: error: previous definition of 'stat' was here > [...] > > Sounds like a bug in the header file to me: > > 215 extern int __REDIRECT_NTH (stat, (__const char *__restrict __file, > 216 struct stat *__restrict __buf), > stat64) > 217 __nonnull ((1, 2)); > > 363 extern __inline__ int > 364 __NTH (stat (__const char *__path, struct stat *__statbuf)) > 365 { > 366 return __xstat (_STAT_VER, __path, __statbuf); > 367 } > > The second one is missing the restrict qualifier. Could that > be the cause, possibly induced by invoking the C99 standard > during compiling with -std=gnu99 ?
Both prototypes will be enabled if you compile with: * __USE_FILE_OFFSET64 defined (which is the case here through -D_FILE_OFFSET_BITS=64) * __REDIRECT_NTH defined and a gcc of version >= 2.x (to enable the later decl). Later digging shows that __REDIRECT_NTH seems to always be defined. Though on an amd64, or an i386 having both the prototype with and without __restrict causes no problem whatsoever. it seems that this: #include <sys/stat.h> int main(void) { struct stat st; return stat("/etc/passwd", &st); } compiles correctly with an almost up to date etch alpha machine. We will have to wait for an alpha machine to be accessible to developpers again to test it further. -- ·O· Pierre Habouzit ··O [EMAIL PROTECTED] OOO http://www.madism.org
pgpWFI8qqtQ4i.pgp
Description: PGP signature