[U-Boot-Users] [PATCH] fix compilation for gcc 2.95

Robert Schwebel robert at schwebel.de
Sat Jun 12 21:04:47 CEST 2004


This makes the code compile with gcc-2.95 again. Changelog is in patch,
please apply.

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hornemannstraße 12,  31137 Hildesheim, Germany
    Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4
-------------- next part --------------
# 
# Author:       Robert Schwebel <r.schwebel at pengutronix.de>
# 
# Description:  Changelog Entry:
#
#               * Patch by Robert Schwebel, 12 June  2004:
#		  variable declaration is not allowed outside 
#		  declaration part (breaks for gcc < 3)
#
# State:        2004-06-12: submitted
#

diff -urN u-boot-maintainance/common/cmd_jffs2.c u-boot-maintainance-gcc34/common/cmd_jffs2.c
--- u-boot-maintainance/common/cmd_jffs2.c	2004-06-12 16:03:12.000000000 +0200
+++ u-boot-maintainance-gcc34/common/cmd_jffs2.c	2004-06-12 16:02:39.000000000 +0200
@@ -127,15 +127,16 @@
     char *fsname;
 
 	char *filename;
+	ulong offset;
+	int size;
+	struct part_info *part;
 
 	/* pre-set Boot file name */
 	if ((filename = getenv("bootfile")) == NULL) {
 		filename = "uImage";
 	}
 
-	ulong offset = load_addr;
-	int size;
-	struct part_info *part;
+	offset = load_addr;
 
 	if (argc == 2) {
 		filename = argv[1];


More information about the U-Boot mailing list