Subject: port-evbsh3/29334: "uninitialized variable" when building evbsh3 kernel
To: None <port-evbsh3-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 02/11/2005 13:46:01
>Number: 29334
>Category: port-evbsh3
>Synopsis: "uninitialized variable" when building evbsh3 kernel
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: port-evbsh3-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Feb 11 13:46:00 +0000 2005
>Originator: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release: today's source
>Organization:
>Environment:
System: NetBSD kaeru 2.99.14 NetBSD 2.99.14 (build.kaeru) #190: Thu Feb 10 18:54:51 JST 2005 takashi@kaeru:/home/takashi/work/kernel/build.kaeru i386
Architecture: i386
Machine: i386
>Description:
i got the following when cross-building from i386.
/exports/nbsd/src/sys/arch/evbsh3/evbsh3/machdep.c: In function `intc_intr':
/exports/nbsd/src/sys/arch/evbsh3/evbsh3/machdep.c:741: warning: `evtcode' might be used uninitialized in this function
*** [machdep.o] Error code 1
1 error
nbmake: stopped in /exports/abhome/build/evbsh3/COMPUTEXEVB
>How-To-Repeat:
see above.
>Fix:
Index: machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbsh3/evbsh3/machdep.c,v
retrieving revision 1.51
diff -u -p -r1.51 machdep.c
--- machdep.c 24 Mar 2004 15:34:48 -0000 1.51
+++ machdep.c 11 Feb 2005 13:41:23 -0000
@@ -738,7 +738,7 @@ intc_intr(int ssr, int spc, int ssp)
{
struct intc_intrhand *ih;
struct clockframe cf;
- int s, evtcode;
+ int s, evtcode = 0; /* XXX: gcc */
switch (cpu_product) {
case CPU_PRODUCT_7708:
@@ -754,6 +754,8 @@ intc_intr(int ssr, int spc, int ssp)
case CPU_PRODUCT_7750S:
evtcode = _reg_read_4(SH4_INTEVT);
break;
+ default:
+ panic("intc_intr: unknown cpu_product %d", cpu_product);
}
ih = EVTCODE_IH(evtcode);
>Unformatted: