Subject: kern/7952: printf format warnings if IPSEC_DEBUG defined
To: None <gnats-bugs@gnats.netbsd.org>
From: Dave Huang <khym@bga.com>
List: netbsd-bugs
Date: 07/09/1999 21:35:44
>Number:         7952
>Category:       kern
>Synopsis:       printf format warnings if IPSEC_DEBUG defined
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul  9 21:35:01 1999
>Last-Modified:
>Originator:     Dave Huang
>Organization:
Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 23 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
>Release:        NetBSD-current as of July 9, 1999
>Environment:
	
System: NetBSD yerfable.metonymy.com 1.4D NetBSD 1.4D (YERFABLE) #12: Mon Jul 5 01:41:24 CDT 1999 khym@yerfable.metonymy.com:/usr/src.local/sys/arch/alpha/compile/YERFABLE alpha


>Description:
	If INET6, IPSEC and IPSEC_DEBUG are defined, a kernel compile
on alpha fails with:
cc  -O2 -mcpu=21164 -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes  -Wpointer-arith -Wno-main -mno-fp-regs -I. -I../../../../arch -I../../../.. -nostdinc -DDIAGNOSTIC -DINET6 -DIPSEC -DIPSEC_DEBUG -DDEBUG -DLKM -DSCSI_NCR_SYMBIOS_COMPAT -DMAXUSERS=32 -D_KERNEL -Dalpha  -c ../../../../netinet6/ipsec.c
cc1: warnings being treated as errors
../../../../netinet6/ipsec.c: In function `ipsec4_hdrsiz':
../../../../netinet6/ipsec.c:1534: warning: int format, different type arg (arg 2)
../../../../netinet6/ipsec.c: In function `ipsec6_hdrsiz':
../../../../netinet6/ipsec.c:1572: warning: int format, different type arg (arg 2)

>How-To-Repeat:
	See above.
>Fix:
--- /usr/src/sys/netinet6/ipsec.c	Tue Jul  6 06:19:51 1999
+++ ipsec.c	Fri Jul  9 23:08:29 1999
@@ -1531,7 +1531,7 @@
 	KEYDEBUG(KEYDEBUG_IPSEC_STAMP,
 		printf("DP ipsec4_hdrsiz call free SP:%p\n", sp));
 	KEYDEBUG(KEYDEBUG_IPSEC_DATA,
-		printf("ipsec4_hdrsiz: size:%d.\n", size));
+		printf("ipsec4_hdrsiz: size:%lu.\n", (unsigned long)size));
 	key_freesp(sp);
 
 	return size;
@@ -1569,7 +1569,7 @@
 	KEYDEBUG(KEYDEBUG_IPSEC_STAMP,
 		printf("DP ipsec6_hdrsiz call free SP:%p\n", sp));
 	KEYDEBUG(KEYDEBUG_IPSEC_DATA,
-		printf("ipsec6_hdrsiz: size:%d.\n", size));
+		printf("ipsec6_hdrsiz: size:%lu.\n", (unsigned long)size));
 	key_freesp(sp);
 
 	return size;

>Audit-Trail:
>Unformatted: