[coreboot] [patch]: avoid mcp55_early_setup_car.c compile failure when gcc 4.5.0 is used

Scott Duplichan scott at notabs.org
Tue Oct 26 06:49:30 CEST 2010


When gcc 4.5.0 is used, compiling mcp55_early_setup_car.c fails:

$ make
which: svnversion: unknown command
which: git: unknown command
    GEN        build.h
    CC         romstage.inc
cc1.exe: warnings being treated as errors
src/mainboard/gigabyte/m57sli/romstage.c: In function 'cache_as_ram_main':
src/southbridge/nvidia/mcp55/mcp55_early_setup_car.c:366:11: error: 'busn[0u]' may be used uninitialized in this function
src/southbridge/nvidia/mcp55/mcp55_early_setup_car.c:366:11: note: 'busn[0u]' was declared here
src/southbridge/nvidia/mcp55/mcp55_early_setup_car.c:367:11: error: 'devn[0u]' may be used uninitialized in this function
src/southbridge/nvidia/mcp55/mcp55_early_setup_car.c:367:11: note: 'devn[0u]' was declared here
src/southbridge/nvidia/mcp55/mcp55_early_setup_car.c:368:11: error: 'io_base[0u]' may be used uninitialized in this function
src/southbridge/nvidia/mcp55/mcp55_early_setup_car.c:368:11: note: 'io_base[0u]' was declared here
make: *** [build/mainboard/gigabyte/m57sli/romstage.pre.inc] Error 1

This is the only failure from abuild with gcc 4.5.0. Should we play
along (at the expense of a few extra bytes of code generation)? If so:

Signed-off-by: Scott Duplichan <scott at notabs.org>

Index: src/southbridge/nvidia/mcp55/mcp55_early_setup_car.c
--- src/southbridge/nvidia/mcp55/mcp55_early_setup_car.c	(revision 5987)
+++ src/southbridge/nvidia/mcp55/mcp55_early_setup_car.c	(working copy)
@@ -363,9 +363,9 @@
 static int mcp55_early_setup_x(void)
 	/*find out how many mcp55 we have */
-	unsigned busn[HT_CHAIN_NUM_MAX];
-	unsigned devn[HT_CHAIN_NUM_MAX];
-	unsigned io_base[HT_CHAIN_NUM_MAX];
+	unsigned busn[HT_CHAIN_NUM_MAX] = {0};
+	unsigned devn[HT_CHAIN_NUM_MAX] = {0};
+	unsigned io_base[HT_CHAIN_NUM_MAX] = {0};
 		FIXME: May have problem if there is different MCP55 HTX card with different PCI_E lane allocation
 		Need to use same trick about pci1234 to verify node/link connection

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mpc55.txt
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20101025/f1022657/attachment.txt>

More information about the coreboot mailing list