Bug in compile of rsync 2.5.4 on Tru64 UNIX V5.1a using cc on AlphaServer 1000 5/300

Eckert, Robert D eckert at indiana.edu
Fri Mar 22 09:52:59 EST 2002


Hi Paul, your suggestion about batch.c got by the compiler without a
peep and it got much farther along again with complaint from cc until....

[root at hyperion: rsync-2.5.4]#CC=cc; export CC; ./configure
configure: Configuring rsync 2.5.4
checking build system type... alphaev5-dec-osf5.1
checking host system type... alphaev5-dec-osf5.1
checking target system type... alphaev5-dec-osf5.1
checking for gcc... cc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for executable suffix... 
checking for object suffix... o
checking whether we are using the GNU C compiler... no
checking whether cc accepts -g... yes
checking how to run the C preprocessor... cc -E
checking for a BSD compatible install... ./install-sh -c
checking for cc option to accept ANSI C... none needed
checking whether to include debugging symbols... yes
checking for remsh... 0
checking for broken largefile support... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGE_FILES value needed for large files... no
checking ipv6 stack type... unknown
checking for library containing getaddrinfo... no
checking whether byte ordering is bigendian... no
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... no
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/fcntl.h... yes
checking for sys/select.h... yes
checking for fcntl.h... yes
checking for sys/time.h... yes
checking for sys/unistd.h... no
checking for unistd.h... yes
checking for utime.h... yes
checking for grp.h... yes
checking for compat.h... no
checking for sys/param.h... yes
checking for ctype.h... yes
checking for sys/wait.h... (cached) yes
checking for sys/ioctl.h... yes
checking for sys/filio.h... no
checking for string.h... yes
checking for stdlib.h... yes
checking for sys/socket.h... yes
checking for sys/mode.h... yes
checking for glob.h... yes
checking for alloca.h... yes
checking for mcheck.h... no
checking for sys/sysctl.h... no
checking for arpa/inet.h... yes
checking for arpa/nameser.h... yes
checking for netdb.h... yes
checking for malloc.h... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... no
checking for unistd.h... (cached) yes
checking for int... yes
checking size of int... 4
checking for long... yes
checking size of long... 8
checking for short... yes
checking size of short... 2
checking for inline... inline
checking return type of signal handlers... void
checking for uid_t in sys/types.h... yes
checking for mode_t... yes
checking for off_t... yes
checking for size_t... yes
checking for pid_t... yes
checking type of array argument to getgroups... gid_t
checking for struct stat.st_rdev... yes
checking for ino_t... yes
checking for socklen_t... no
checking for socklen_t equivalent... int
checking for errno in errno.h... yes
checking for connect... yes
checking for inet_ntop in -lresolv... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for getaddrinfo... no
checking for getnameinfo... yes
checking for struct sockaddr.sa_len... no
checking struct sockaddr_storage... yes
checking for strcasecmp... yes
checking whether utime accepts a null argument... yes
checking for waitpid... yes
checking for wait4... yes
checking for getcwd... yes
checking for strdup... yes
checking for strerror... yes
checking for chown... yes
checking for chmod... yes
checking for mknod... yes
checking for fchmod... yes
checking for fstat... yes
checking for strchr... yes
checking for readlink... yes
checking for link... yes
checking for utime... yes
checking for utimes... yes
checking for strftime... yes
checking for memmove... yes
checking for lchown... yes
checking for vsnprintf... yes
checking for snprintf... yes
checking for asprintf... no
checking for setsid... yes
checking for glob... yes
checking for strpbrk... yes
checking for strlcat... no
checking for strlcpy... no
checking for mtrace... no
checking for mallinfo... yes
checking for setgroups... yes
checking for working socketpair... yes
checking for working fnmatch... yes
checking for poptGetContext in -lpopt... no
checking whether to use included libpopt... ./popt
checking for long long... yes
checking for off64_t... no
checking for short ino_t... no
checking for unsigned char... no
checking for broken readdir... no
checking for utimbuf... yes
checking if gettimeofday takes tz argument... yes
checking for C99 vsnprintf... no
checking for secure mkstemp... yes
checking for broken inet_ntoa... no
checking for broken inet_aton... no
checking whether -c -o works... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/dummy
config.status: creating zlib/dummy
config.status: creating popt/dummy
config.status: creating shconfig
config.status: creating config.h

    rsync 2.5.4 configuration successful

[root at hyperion: rsync-2.5.4]#echo $CC
cc
[root at hyperion: rsync-2.5.4]#make
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c rsync.c -o rsync.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c generator.c -o generator.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c receiver.c -o receiver.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c cleanup.c -o cleanup.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c sender.c -o sender.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c exclude.c -o exclude.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c util.c -o util.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c main.c -o main.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c checksum.c -o checksum.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c match.c -o match.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c syscall.c -o syscall.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c log.c -o log.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c backup.c -o backup.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c options.c -o options.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c flist.c -o flist.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c io.c -o io.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c compat.c -o compat.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c hlink.c -o hlink.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c token.c -o token.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c uidlist.c -o uidlist.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c socket.c -o socket.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c fileio.c -o fileio.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c batch.c -o batch.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c clientname.c -o clientname.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c params.c -o params.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c loadparm.c -o loadparm.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c clientserver.c -o clientserver.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c access.c -o access.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c connection.c -o connection.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c authenticate.c -o authenticate.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c lib/fnmatch.c -o lib/fnmatch.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c lib/compat.c -o lib/compat.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c lib/snprintf.c -o lib/snprintf.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c lib/mdfour.c -o lib/mdfour.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c lib/permstring.c -o
lib/permstring.o
cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c lib/getaddrinfo.c -o
lib/getaddrinfo.o
cc: Error: lib/getaddrinfo.c, line 180: In this statement, "EAI_MAX" is not
declared. (undeclared)
        if (ecode < 0 || ecode > EAI_MAX)
---------------------------------^
cc: Error: lib/getaddrinfo.c, line 262: In this statement, "EAI_BADHINTS" is
not declared. (undeclared)
                        ERR(EAI_BADHINTS); /* xxx */
------------------------^
cc: Error: lib/getaddrinfo.c, line 263: In this statement, "AI_MASK" is not
declared. (undeclared)
                if (hints->ai_flags & ~AI_MASK)
---------------------------------------^
cc: Error: lib/getaddrinfo.c, line 297: In this statement, "EAI_BADHINTS" is
not declared. (undeclared)
                                ERR(EAI_BADHINTS);      /*xxx*/
--------------------------------^
cc: Error: lib/getaddrinfo.c, line 303: In this statement, "EAI_BADHINTS" is
not declared. (undeclared)
                                ERR(EAI_BADHINTS);      /*xxx*/
--------------------------------^
cc: Error: lib/getaddrinfo.c, line 353: In this statement, "EAI_PROTOCOL" is
not declared. (undeclared)
                                        ERR(EAI_PROTOCOL);      /*xxx*/
----------------------------------------^
*** Exit 1
Stop.


Any help you can give on this one is much appreciated! I'd love to
get a perfectly clean compile on V51a using cc. I also have gcc 3.0.3
installed if you'd like me to run it through that too. The README said to
try your platform's cc first because of large-file problems with gcc that
might interfere? So I heeded the advice.

-Bob













-----Original Message-----
From: Paul Haas [mailto:paulh at hamjudo.com] 
Sent: Thursday, March 21, 2002 4:46 PM
To: Eckert, Robert D
Cc: 'rsync at samba.org'
Subject: Re: Bug in compile of rsync 2.5.4 on Tru64 UNIX V5.1a using cc


On Thu, 21 Mar 2002, Eckert, Robert D wrote:

> Greetings, here is the output of the 'configure' step and
> the compile step (using the Compaq cc compiler that comes with Tru64 
> V5.1A. The configure reported success and most of the compile steps 
> cam through error/warning free except for the one that stumbled. Can 
> someone help me out here? I am willing to provide a binary for Tru64 
> V5.1A if we can swat this bug. We depend greatly on Rsync to keep a 
> fresh backup of our 70gb storage system that is the backend of 
> http://www.indiana.edu/, Indiana University's main web site to the 
> Internet. We're also big fans and soon to be BIG adopters of Samba 
> 2.2.3a.

> Anyway here is the sequence that was encountered:
> cc -I. -I. -g -DHAVE_CONFIG_H -I./popt -c batch.c -o batch.o
> cc: Error: batch.c, line 408: In this statement, a common type could 
> not be determined for the 2nd and 3rd operands ("&s->count" and 
> "&int_zero") of a conditional operator. (badcondit)
>         write_batch_csums_file(s ? &s->count : &int_zero, 
> sizeof(int)); -------------------------------^
> *** Exit 1

Line 406 says:

  /* FIXME: This will break if s->count is ever not exactly an int. */

  s->count is a size_t, which is 64 bits on your compiler.

Here's how I would fix it:

===================================================================
RCS file: RCS/batch.c,v
retrieving revision 1.1
diff -u -r1.1 batch.c
--- batch.c     2002/03/21 21:31:52     1.1
+++ batch.c     2002/03/21 21:44:11
@@ -396,16 +396,17 @@
                           struct sum_struct *s)
 {
        size_t i;
-       unsigned int int_zero = 0;
+       unsigned int int_count;
        extern int csum_length;

        fdb_open = 1;

        /* Write csum info to batch file */

-       /* FIXME: This will break if s->count is ever not exactly an int. */
+       /* FIXME: This will break if s->count is ever greater than 2^32 
+ -1 */
        write_batch_csums_file(flist_entry, sizeof(int));
-       write_batch_csums_file(s ? &s->count : &int_zero, sizeof(int));
+       int_count = s ? (unsigned int) s->count : 0;
+       write_batch_csums_file(&int_count, sizeof(int_count));

        if (s) {
                for (i = 0; i < s->count; i++) {





More information about the rsync mailing list