Subject: state variable is not declared in asc_disconnect() in some case
To: None <port-pmax@NetBSD.ORG>
From: Masuda Hideo <h-masuda@verdandi.ics.es.osaka-u.ac.jp>
List: port-pmax
Date: 08/16/1996 02:38:21
I'll compile kernel for NetBSD/pmax 1.2Beta by Suped sources.
I config kernel by enabling DIAGNOSTIC option then compile is failed
in ../../../../dev/tc/asc.c as following reason:
cc -O2 -Werror -I. -I../../../../arch -I../../../.. -DCPU_R3000 -DDS3100 -DTIMEZONE="-9*60" -DDST="0" -DSWAPPAGER -DVNODEPAGER -DDEVPAGER -DDIAGNOSTIC -DDEBUG -DCOMPAT_43 -DKTRACE -DNKMEMCLUSTERS=1024 -DFIFO -DFFS -DQUOTA -DMFS -DNFSCLIENT -DNFSSERVER -DKERNFS -DFDESC -DUMAPFS -DNULLFS -DLFS -DPORTAL -DINET -DTCP_COMPAT_42 -DGATEWAY -DMULTICAST -DMROUTING -DCOMPAT_ULTRIX -DHZ=256 -D_KERNEL -Dpmax -c ../../../../dev/tc/asc.c
../../../../dev/tc/asc.c: In function `asc_disconnect':
../../../../dev/tc/asc.c:2139: `state' undeclared (first use this function)
../../../../dev/tc/asc.c:2139: (Each undeclared identifier is reported only once
../../../../dev/tc/asc.c:2139: for each function it appears in.)
*** Error code 1
../../../../dev/tc/asc.c ---
2127 /* ARGSUSED */
2128 static int
2129 asc_disconnect(asc, status, ss, ir)
2130 register asc_softc_t asc;
2131 register int status, ss, ir;
2132 {
2133 #if MACH_DDIAGNOSTIC
2134 /* later Mach driver checks for late asych disconnect here. */
2135 register State *state = &asc->st[asc->target];
2136 #endif
2137
2138 #ifdef DIAGNOSTIC
2139 if (!(state->flags & DISCONN)) {
2140 printf("asc_disconnect: device %d: DISCONN not set!\n",
2141 asc->target);
2142 }
2143 #endif /*DIAGNOSTIC*/
2144 asc->target = -1;
2145 asc->state = ASC_STATE_RESEL;
2146 return (1);
2147 }
---
I think that "#ifdef DIAGNOSTIC" in line 2138 should be
"#if defined(DIAGNOSTIC) && MACH_DDIAGNOSTIC". Is this true ?
Thank you.
---
Hideo Masuda (h-masuda@ics.es.osaka-u.ac.jp)
Dept. of Information and Computer Sciences,
Faculty of Engineering Science, Osaka University
asc.c-diff
*** asc.c-dist Sat Aug 3 20:42:43 1996
--- asc.c Fri Aug 16 02:35:39 1996
***************
*** 2135,2146 ****
register State *state = &asc->st[asc->target];
#endif
! #ifdef DIAGNOSTIC
if (!(state->flags & DISCONN)) {
printf("asc_disconnect: device %d: DISCONN not set!\n",
asc->target);
}
! #endif /*DIAGNOSTIC*/
asc->target = -1;
asc->state = ASC_STATE_RESEL;
return (1);
--- 2135,2146 ----
register State *state = &asc->st[asc->target];
#endif
! #if defined(DIAGNOSTIC) && MACH_DDIAGNOSTIC
if (!(state->flags & DISCONN)) {
printf("asc_disconnect: device %d: DISCONN not set!\n",
asc->target);
}
! #endif /* defined(DIAGNOSTIC) && MACH_DDIAGNOSTIC */
asc->target = -1;
asc->state = ASC_STATE_RESEL;
return (1);