Subject: Re: build failed for /usr/src/lib/libpcap/gencode
To: None <kurt.schreiner@uni-mainz.de>
From: None <itojun@iijlab.net>
List: current-users
Date: 07/05/1999 21:36:00
>just got this one doing a 'make build' (on an ss5...) sources supped 2
>hours ago:
>cc -O2  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror   -I. -I/import/src/lib/libpcap -DYYBISON -DINET6 -DHAVE_MALLOC_H=1 -DHAVE_SYS_IOCCOM_H=1 -DHAVE_SYS_SOCKIO_H=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 -DHAVE_SOCKADDR_SA_LE
N=1 -c /import/src/lib/libpcap/gencode.c
>cc1: warnings being treated as errors
>/import/src/lib/libpcap/gencode.c: In function `gen_mcode6':
>/import/src/lib/libpcap/gencode.c:2234: warning: int format, long int arg (arg 2)
>*** Error code 1
>Stop.

	Does the attached patch fix this?
	Is return type of sizeof long on sparc?

itojun



Index: gencode.c
===================================================================
RCS file: /cvsroot/basesrc/lib/libpcap/gencode.c,v
retrieving revision 1.14
diff -c -r1.14 gencode.c
*** gencode.c	1999/07/02 16:03:41	1.14
--- gencode.c	1999/07/05 12:34:57
***************
*** 2231,2237 ****
  	addr = &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
  
  	if (sizeof(mask) * 8 < masklen)
! 		bpf_error("mask length must be <= %d", sizeof(mask) * 8);
  	memset(&mask, 0xff, masklen / 8);
  	if (masklen % 8) {
  		mask.s6_addr8[masklen / 8] =
--- 2231,2237 ----
  	addr = &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
  
  	if (sizeof(mask) * 8 < masklen)
! 		bpf_error("mask length must be <= %ld", (long)sizeof(mask) * 8);
  	memset(&mask, 0xff, masklen / 8);
  	if (masklen % 8) {
  		mask.s6_addr8[masklen / 8] =