Skip to contentSkip to conversation

common/cmd_pxe.c: Fix GCC 4.6 build warnings

PATCH New Heiko Schocher 3 participants 3 messages Dec 13, 2011 – Dec 19, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/cmd_pxe.c: Fix GCC 4.6 build warnings

Fix:
cmd_pxe.c: In function 'parse_pxefile_top':
cmd_pxe.c:941:5: warning: 'err' may be used uninitialized in this
function [-Wuninitialized]
cmd_pxe.c:921:6: note: 'err' was declared here

---
 common/cmd_pxe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_pxe.c +1 -1
index 9426f5b..7c0cb66 100644
@@ -918,7 +918,7 @@ static int parse_menu(char **c, struct pxe_menu *cfg, char *b, int nest_level)
 {
 	struct token t;
 	char *s = *c;
-	int err;
+	int err = 0;
 
 	get_token(c, &t, L_KEYWORD);
 
Signature · 1 line
1.7.6.4
#1 lore raw

PATCH 1/1 common/cmd_pxe.c: Fix GCC 4.6 build warnings

Dear Heiko,

Thanks for the fix.

Quoted 8 lines · Heiko Schocher

Fix:
cmd_pxe.c: In function 'parse_pxefile_top':
cmd_pxe.c:941:5: warning: 'err' may be used uninitialized in this
function [-Wuninitialized]
cmd_pxe.c:921:6: note: 'err' was declared here

Quoted 20 lines
---
 common/cmd_pxe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_pxe.c +1 -1
index 9426f5b..7c0cb66 100644
@@ -918,7 +918,7 @@ static int parse_menu(char **c, struct pxe_menu *cfg, char *b, int nest_level)
 {
 	struct token t;
 	char *s = *c;
-	int err;
+	int err = 0;
 
 	get_token(c, &t, L_KEYWORD);
 
Signature · 1 line
1.7.6.4
#2 lore raw

PATCH 1/1 common/cmd_pxe.c: Fix GCC 4.6 build warnings

In reply to Heiko Schocher

Hi Heiko,

Quoted 11 lines · On Tue, 13 Dec 2011 07:37:17 +0100 Heiko Schocher <[email protected]> wrote:

Fix:
cmd_pxe.c: In function 'parse_pxefile_top':
cmd_pxe.c:941:5: warning: 'err' may be used uninitialized in this
function [-Wuninitialized]
cmd_pxe.c:921:6: note: 'err' was declared here

---
 common/cmd_pxe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to u-boot-staging/agust at denx.de.

Thanks!

Anatolij