Subject: kern/5328: Kernel build fails if PCIVERBOSE not specified
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mynhier@cs.utk.edu>
List: netbsd-bugs
Date: 04/19/1998 17:29:27
>Number: 5328
>Category: kern
>Synopsis: kernel build fails if PCIVERBOSE not defined
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Apr 19 17:35:01 1998
>Last-Modified:
>Originator: Chad Mynhier
>Organization:
>Release: NetBSD-current as of Sun Apr 19 17:11:50 PDT 1998
>Environment:
System: NetBSD priapus 1.3E NetBSD 1.3E (PRIAPUS) #11: Thu Apr 9 14:04:42 EDT 1998 root@priapus:/home/mynhier/netbsd/source-current/src/sys/arch/i386/compile/PRIAPUS i386
>Description:
Kernel build fails if PCIVERBOSE not defined. Here are the
error message:
priapus# make
cc -O2 -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main -I. -I../../../../arch -I../../../.. -nostdinc -DCONSDEVNAME=\"com\" -DCONADDR="0x2f8" -DCONSPEED="0x2580" -DKTRACE -DSYSVMSG -DSYSVSEM -DSYSVSHM -DLKM -DDIAGNOSTIC -DDDB -DCOMPAT_NOMID -DCOMPAT_09 -DCOMPAT_10 -DCOMPAT_11 -DCOMPAT_12 -DCOMPAT_13 -DCOMPAT_43 -DCOMPAT_386BSD_MBRPART -DCOMPAT_SVR4 -DCOMPAT_IBCS2 -DCOMPAT_LINUX -DCOMPAT_FREEBSD -DNFSSERVER -DFIFO -DINET -DPPP_BSDCOMP -DPPP_DEFLATE -DMAXUSERS=32 -D_KERNEL -Di386 -c ../../../../dev/pci/pci_subr.c
cc1: warnings being treated as errors
../../../../dev/pci/pci_subr.c: In function `pci_conf_print':
../../../../dev/pci/pci_subr.c:329: warning: unused variable `off_str'
../../../../dev/pci/pci_subr.c:329: warning: unused variable `on_str'
*** Error code 1
Stop.
priapus#
Here's the file info for /usr/src/sys/dev/pci/pci_subr.c:
/* $NetBSD: pci_subr.c,v 1.22 1998/04/14 21:24:50 thorpej Exp $ */
>How-To-Repeat:
Build a kernel with PCIVERBOSE undefined.
>Fix:
*** pci_subr.c Sun Apr 19 16:01:38 1998
--- pci_subr.c.fixed Sun Apr 19 17:27:35 1998
***************
*** 324,332 ****
int reg;
#ifdef PCIVERBOSE
struct pci_knowndev *kdp;
#endif
struct pci_class *classp, *subclassp;
- static const char on_str[] = "ON", off_str[] = "OFF";
printf("PCI configuration registers:\n");
--- 324,332 ----
int reg;
#ifdef PCIVERBOSE
struct pci_knowndev *kdp;
+ static const char on_str[] = "ON", off_str[] = "OFF";
#endif
struct pci_class *classp, *subclassp;
printf("PCI configuration registers:\n");
***************
*** 354,366 ****
printf(" Device ID: 0x%04x\n", PCI_PRODUCT(rval));
#endif /* PCIVERBOSE */
- #define onoff(reg) ((rval & (reg)) ? on_str : off_str)
-
rval = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
#ifndef PCIVERBOSE
printf(" Command/Status Register: 0x%08x\n", rval);
#else
printf(" Command Register:\n");
printf(" I/O space accesses %s\n", onoff(PCI_COMMAND_IO_ENABLE));
printf(" Mem space accesses %s\n", onoff(PCI_COMMAND_MEM_ENABLE));
--- 354,365 ----
printf(" Device ID: 0x%04x\n", PCI_PRODUCT(rval));
#endif /* PCIVERBOSE */
rval = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
#ifndef PCIVERBOSE
printf(" Command/Status Register: 0x%08x\n", rval);
#else
+ #define onoff(reg) ((rval & (reg)) ? on_str : off_str)
printf(" Command Register:\n");
printf(" I/O space accesses %s\n", onoff(PCI_COMMAND_IO_ENABLE));
printf(" Mem space accesses %s\n", onoff(PCI_COMMAND_MEM_ENABLE));
>Audit-Trail:
>Unformatted: