Subject: consinit.c: unused variable `error'
To: None <current-users@netbsd.org>
From: Jukka Salmi <j+nbsd@2005.salmi.ch>
List: current-users
Date: 05/06/2005 00:45:32
--rwEMma7ioTxnRzrJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

src/sys/arch/x86/x86/consinit.c was recently changed; for a custom kernel
(based on NET4501), I had to apply the attached patch to get rid of the
following warning and to make the build succeed:

#   compile  CLAM/consinit.o
cc -ffreestanding -Os -mcpu=i486 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -fno-zero-initialized-in-bss -Di386 -I. -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DTIMER_FREQ=1189200 -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -I/usr/src/sys/dist/ipf -c /usr/src/sys/arch/x86/x86/consinit.c
/usr/src/sys/arch/x86/x86/consinit.c: In function `consinit':
/usr/src/sys/arch/x86/x86/consinit.c:147: warning: unused variable `error'
*** Error code 1

Is this the correct fix?


Cheers, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

--rwEMma7ioTxnRzrJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="consinit.c.patch"

--- src/sys/arch/x86/x86/consinit.c.orig	2005-05-01 18:34:46.000000000 +0200
+++ src/sys/arch/x86/x86/consinit.c	2005-05-06 00:34:03.000000000 +0200
@@ -144,7 +144,9 @@
 {
 	const struct btinfo_console *consinfo;
 	static int initted;
+#if (NPC > 0) || (NVGA > 0) || (NEGA > 0) || (NPCDISPLAY > 0)
 	int error;
+#endif
 
 	if (initted)
 		return;

--rwEMma7ioTxnRzrJ--