Subject: kern/13231: sys/dev/sun/fb.c: unused variables with RASTERCONS_FULLSCREEN defined, -Werror breaks compile
To: None <gnats-bugs@gnats.netbsd.org>
From: None <rob@arpa.com>
List: netbsd-bugs
Date: 06/17/2001 11:04:11
>Number:         13231
>Category:       kern
>Synopsis:       sys/dev/sun/fb.c: unused variables with RASTERCONS_FULLSCREEN defined, -Werror breaks kernel compile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 17 09:02:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Rob Misiak
>Release:        6/17/01 srcs
>Organization:
>Environment:
	NetBSD/sparc, cgsix on SS5, with RASTERCONS_SMALLFONT and RASTERCONS_FULLSCREEN defined.
System: NetBSD mercury 1.5W NetBSD 1.5W (MERCURY) #31: Sat Jun 9 20:20:48 CDT 2001 rob@mercury:/usr/obj/sys/arch/sparc/MERCURY sparc
Architecture: sparc
Machine: sparc
>Description:
	defining RASTERCONS_FULLSCREEN in kernel config breaks the kernel compile (because of -Werror):

cc  -O2 -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes  -Wpointer-arith -Wno-uninitialized -Wno-main -mno-fpu -I. -I/usr/src/sys/arch -I
/usr/src/sys -nostdinc -DSUN4M -DRASTERCONSOLE -DRASTERCONS_SMALLFONT -DRASTERCONS_FULLSCREEN -DLKM -DFDSCRIPTS -DSETUIDSCRIPTS -DMAXUSERS=32 -D
_KERNEL -D_KERNEL_OPT  -c /usr/src/sys/dev/sun/fb.c
cc1: warnings being treated as errors
/usr/src/sys/dev/sun/fb.c: In function `fbrcons_init':
/usr/src/sys/dev/sun/fb.c:360: warning: unused variable `col'
/usr/src/sys/dev/sun/fb.c:360: warning: unused variable `row'
*** Error code 1

>How-To-Repeat:
	kernel config:

options RASTERCONS_FULLSCREEN

>Fix:

Index: fb.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/sun/fb.c,v
retrieving revision 1.2
diff -u -r1.2 fb.c
--- fb.c	2000/10/31 21:54:35	1.2
+++ fb.c	2001/06/17 15:50:58
@@ -357,7 +357,10 @@
 {
 	struct rconsole	*rc = &fb->fb_rcons;
 	struct rasops_info *ri = &fb->fb_rinfo;
-	int maxrow, maxcol, *row, *col;
+	int maxrow, maxcol;
+#if !defined(RASTERCONS_FULLSCREEN)
+	int *row, *col;
+#endif /* !RASTERCONS_FULLSCREEN */
 
 	/* Set up what rasops needs to know about */
 	bzero(ri, sizeof *ri);
>Release-Note:
>Audit-Trail:
>Unformatted: