bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sharutils: compilation failure with Sun C on Linux


From: Bruce Korb
Subject: Re: sharutils: compilation failure with Sun C on Linux
Date: Sun, 14 May 2006 08:57:56 -0700
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

Bruno Haible wrote:
Hi,

When compiling sharutils-4.6.1 with SunPRO C 5.9 on Linux/x86 with glibc-2.3.x,
the following compilation error occurs:

/opt/sun/compilers-20060314/bin/c89 -Xa 
-DLOCALEDIR=\"/packages/inst-sunpro/share/locale\" -DHAVE_CONFIG_H -I. -I. -I.. 
 -I. -I.. -I../lib -I../intl -I/packages/inst-sunpro/include  -xO5 -c shar.c
"shar.c", line 141: identifier redeclared: readdir64
        current : function() returning pointer to struct dirent {unsigned long 
long d_ino, long long d_off, unsigned short d_reclen, unsigned char d_type, 
array[256] of char d_name}
        previous: function(pointer to struct __dirstream {}) returning pointer to struct 
dirent64 {unsigned long long d_ino, long long d_off, unsigned short d_reclen, unsigned 
char d_type, array[256] of char d_name} : "/usr/include/dirent.h", line 166
c89: acomp failed for shar.c
make[2]: *** [shar.o] Fehler 2

What's happening is that

The declarations are iffy.  It is unclear why shar.c cannot always get the
declarations out of the system headers, but rather than chase such an obtuse
issue, I am doing as you suggest.

Index: src/shar.c
===================================================================
RCS file: /sources/sharutils/sharutils/src/shar.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -b -B -u -p -u -p -r1.42 -r1.43
--- src/shar.c  27 Mar 2006 02:12:34 -0000      1.42
+++ src/shar.c  14 May 2006 15:53:03 -0000      1.43
@@ -138,7 +138,10 @@ struct tm *localtime ();
 #endif

 DIR *opendir ();
-struct dirent *readdir ();
+#ifndef readdir
+  /* why is this declared here anyway? */
+  struct dirent *readdir ();
+#endif

 #endif /* !NO_WALKTREE */

Index: ChangeLog
===================================================================
RCS file: /sources/sharutils/sharutils/ChangeLog,v
retrieving revision 1.79
retrieving revision 1.80
diff -b -B -u -p -u -p -r1.79 -r1.80
--- ChangeLog   28 Apr 2006 15:08:29 -0000      1.79
+++ ChangeLog   14 May 2006 15:53:03 -0000      1.80
@@ -1,3 +1,7 @@
+2006-05-15  Bruno Haible  <address@hidden>
+
+       * shar.c: declare readdir IFF readdir is not already a #define
+
 2006-04-26  Pavel Roskin  <address@hidden>

        * uudecode.c (read_stduu): Allow characters other than '\n'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]