Subject: bin/21336: Can't compile sys/lib/libsa/subr_prf.c
To: None <gnats-bugs@gnats.netbsd.org>
From: Xavier HUMBERT <xavier@injep.fr>
List: netbsd-bugs
Date: 04/27/2003 09:26:16
>Number:         21336
>Category:       bin
>Synopsis:       Unused vars in kdoprnt, while Werror is on
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 27 07:27:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Xavier HUMBERT
>Release:        NetBSD 1.6Q
>Organization:
INJEP
>Environment:
NetBSD aragorn.injep.fr 1.6Q NetBSD 1.6Q (XAVIER) #1: Tue Apr  1 10:47:50 CEST 2003  root@aragorn.injep.fr:/usr/obj.i386/sys/arch/i386/compile/XAVIER i386
Architecture: i386
Machine: i386
>Description:
build.sh fails in sys/lib/libsa/

output :

/usr/tools.i386/bin/i386--netbsdelf-gcc -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main -Os -mcpu=i386 -ffreestanding  -Werror -I/usr/src/sys/arch/i386/stand/biosboot/../../../..//lib/libsa -DSLOW -DCOMPAT_386BSD_MBRPART -DSUPPORT_PS2 -DSUPPORT_SERIAL=CONSDEV_PC -DDIRECT_SERIAL -DSUPPORT_USTARFS -DPASS_BIOSGEOM -DPASS_MEMMAP -DSTACK_START=0x10000 -nostdinc -I/usr/obj.i386/sys/arch/i386/stand/biosboot -I/usr/src/sys/arch/i386/stand/biosboot/../../../../ -I/usr/src/sys/arch/i386/stand/biosboot/../../../..//arch/i386/stand/lib -I/usr/src/sys/arch/i386/stand/biosboot/../../../..//lib/libsa -D_STANDALONE -nostdinc -isystem /usr/build.i386/usr/include -DHEAP_START=0x20000 -DHEAP_LIMIT=0x50000  -DCOMPAT_UFS  -D__INTERNAL_LIBSA_CREAD -nostdinc -isystem /usr/build.i386/usr/include  -c /usr/src/sys/arch/i386/stand/biosboot/../../../..//lib/libsa/subr_prf.c
cc1: warnings being treated as errors
/usr/src/sys/arch/i386/stand/biosboot/../../../..//lib/libsa/subr_prf.c: In function `kdoprnt':
/usr/src/sys/arch/i386/stand/biosboot/../../../..//lib/libsa/subr_prf.c:86: warning: unused variable `set'
/usr/src/sys/arch/i386/stand/biosboot/../../../..//lib/libsa/subr_prf.c:84: warning: unused variable `n'
*** Error code 1


>How-To-Repeat:
build.
>Fix:
Remove those unused vars
--- subr_prf.c  2003-04-27 08:14:30.000000000 +0200
+++ subr_prf.c.origin   2003-04-26 13:25:47.000000000 +0200
@@ -81,9 +81,9 @@
 kdoprnt(void (*put)(int), const char *fmt, va_list ap)
 {
        char *p;
-       int ch;
+       int ch, n;
        unsigned long ul;
-       int lflag;
+       int lflag, set;
 
        for (;;) {
                while ((ch = *fmt++) != '%') {

>Release-Note:
>Audit-Trail:
>Unformatted: