Subject: kern/4328: kernel with option SCSIDEBUG can't be compiled
To: None <gnats-bugs@gnats.netbsd.org>
From: Matthias Scheler <tron@lyssa.owl.de>
List: netbsd-bugs
Date: 10/23/1997 21:45:01
>Number:         4328
>Category:       kern
>Synopsis:       kernel with option SCSIDEBUG can't be compiled
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 23 12:50:01 1997
>Last-Modified:
>Originator:     Matthias Scheler
>Organization:
Mario Kemper Maintenance Project
>Release:        971021
>Environment:
NetBSD sandra 1.3_ALPHA NetBSD 1.3_ALPHA (SANDRA) #0: Thu Oct 23 12:22:30 MEST 1997     tron@sandra:/src/src/sys/arch/amiga/compile/SANDRA amiga

>Description:
When I tried to compile a kernel with option "SCSIDEBUG" set it failed due
to bad macros in "scsipi_debug.h":

depending the kern library objects
depending the compat library objects
making sure the 68040 FPSP is up to date...
`fpsp.o' is up to date.
cc  -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -O2 -m68060 -Wa,-m68030 -msoft-float -I. -I../../../../arch -I../../../.. -nostdinc -DEXEC_AOUT -DEXEC_SCRIPT -DDRACO -DBB060STUPIDROM -DM68060 -DM060SP -DM68040 -DFPSP -DM68030 -DM68020 -DFPU_EMULATE -DINET -DGATEWAY -DFFS -DNFS -DUNION -DNFSSERVER -DFIFO -DQUOTA -DTCP_COMPAT_42 -DCOMPAT_43 -DCOMPAT_12 -DCOMPAT_SUNOS -DCOMPAT_NOMID -DSYSVSHM -DSYSVMSG -DSYSVSEM -DKTRACE -DLKM -DNKMEMCLUSTERS="0x400" -DUCONSOLE -DDDB -DDIAGNOSTIC -DSCSIDEBUG -DMACHINE_NONCONTIG -DRETINACONSOLE -DULOWELLCONSOLE -DCL5426CONSOLE -DCV64CONSOLE -DTSENGCONSOLE -DGRF_ECS -DGRF_NTSC -DGRF_PAL -DGRF_A2024 -DGRF_AGA -DGRF_SUPER72 -DCV_AGGRESSIVE_TIMING -DMAXUSERS=8 -D_KERNEL  -Dmc68020 -Damiga -DFPCOPROC  -c ../../../../dev/scsipi/scsipi_base.c
../../../../dev/scsipi/scsipi_base.c: In function `scsipi_get_xs':
../../../../dev/scsipi/scsipi_base.c:86: syntax error before `sc_link'
../../../../dev/scsipi/scsipi_base.c:102: syntax error before `do'
../../../../dev/scsipi/scsipi_base.c:117: syntax error before `void'
../../../../dev/scsipi/scsipi_base.c:139: syntax error before `}'
../../../../dev/scsipi/scsipi_base.c:146: syntax error before `scsipi_size'
cc1: warnings being treated as errors
../../../../dev/scsipi/scsipi_base.c:172: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:178: syntax error before `int'
../../../../dev/scsipi/scsipi_base.c:194: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:204: syntax error before `int'
../../../../dev/scsipi/scsipi_base.c:218: `inqbuf' undeclared (first use this function)
../../../../dev/scsipi/scsipi_base.c:218: (Each undeclared identifier is reported only once
../../../../dev/scsipi/scsipi_base.c:218: for each function it appears in.)
../../../../dev/scsipi/scsipi_base.c:219: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:225: syntax error before `int'
../../../../dev/scsipi/scsipi_base.c:237: `type' undeclared (first use this function)
../../../../dev/scsipi/scsipi_base.c:240: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:246: syntax error before `int'
../../../../dev/scsipi/scsipi_base.c:259: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:266: syntax error before `void'
../../../../dev/scsipi/scsipi_base.c:293: warning: `return' with no value, in function returning non-void
../../../../dev/scsipi/scsipi_base.c:296: syntax error before `if'
../../../../dev/scsipi/scsipi_base.c:303: warning: `return' with no value, in function returning non-void
../../../../dev/scsipi/scsipi_base.c:310: syntax error before `retry'
../../../../dev/scsipi/scsipi_base.c:315: warning: `return' with no value, in function returning non-void
../../../../dev/scsipi/scsipi_base.c:348: syntax error before `int'
../../../../dev/scsipi/scsipi_base.c:385: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:396: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:400: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:412: syntax error before `panic'
../../../../dev/scsipi/scsipi_base.c:414: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:417: syntax error before `int'
../../../../dev/scsipi/scsipi_base.c:460: duplicate label `retry'
../../../../dev/scsipi/scsipi_base.c:464: warning: return makes pointer from integer without a cast
../../../../dev/scsipi/scsipi_base.c:483: syntax error before `return'
../../../../dev/scsipi/scsipi_base.c:510: syntax error before `void'
../../../../dev/scsipi/scsipi_base.c:533: syntax error before `void'
../../../../dev/scsipi/scsipi_base.c:541: `num' undeclared (first use this function)
../../../../dev/scsipi/scsipi_base.c:544: `address' undeclared (first use this function)
../../../../dev/scsipi/scsipi_base.c:550: syntax error at end of input
*** Error code 1

Stop.

>How-To-Repeat:
Compile a kernel with "option SCSIDEBUG" in the configuration file.

>Fix:
*** src/sys/dev/scsipi/scsipi_debug.h.orig	Sat Oct  4 14:15:05 1997
--- src/sys/dev/scsipi/scsipi_debug.h	Thu Oct 23 21:41:00 1997
*************** do {									\
*** 33,46 ****
  		sc_link->sc_print_addr(sc_link);			\
   		printf Printstuff;					\
  	}								\
! while (0)
  
  #define	SC_DEBUGN(sc_link,Level,Printstuff) 				\
  do {									\
  	if ((sc_link)->flags & (Level)) {				\
   		printf Printstuff;					\
  	}								\
! while (0)
  #else
  #define SC_DEBUG(A,B,C)
  #define SC_DEBUGN(A,B,C)
--- 33,46 ----
  		sc_link->sc_print_addr(sc_link);			\
   		printf Printstuff;					\
  	}								\
! } while (0)
  
  #define	SC_DEBUGN(sc_link,Level,Printstuff) 				\
  do {									\
  	if ((sc_link)->flags & (Level)) {				\
   		printf Printstuff;					\
  	}								\
! } while (0)
  #else
  #define SC_DEBUG(A,B,C)
  #define SC_DEBUGN(A,B,C)
>Audit-Trail:
>Unformatted: