Subject: Re: consinit.c: unused variable `error'
To: Jukka Salmi <j+nbsd@2005.salmi.ch>
From: Lennart Augustsson <lennart@augustsson.net>
List: current-users
Date: 05/06/2005 02:10:45
That would work.  I just committed a slightly simpler fix.

	-- Lennart

Jukka Salmi wrote:
> 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
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --- 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;