public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cmd_nand: Fix possible uninited max_size variable
@ 2012-03-23 23:27 Marek Vasut
  2012-03-26 16:17 ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2012-03-23 23:27 UTC (permalink / raw)
  To: u-boot

GCC 4.7 error:
cmd_nand.c: In function ?arg_off_size?:
cmd_nand.c:216:5: warning: ?maxsize? may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
---
 common/cmd_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 035a6f6..b015d11 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -191,7 +191,7 @@ static int arg_off_size(int argc, char *const argv[], int *idx,
 			loff_t *off, loff_t *size)
 {
 	int ret;
-	loff_t maxsize;
+	loff_t maxsize = 0;
 
 	if (argc == 0) {
 		*off = 0;
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] cmd_nand: Fix possible uninited max_size variable
  2012-03-23 23:27 [U-Boot] [PATCH] cmd_nand: Fix possible uninited max_size variable Marek Vasut
@ 2012-03-26 16:17 ` Scott Wood
  2012-03-27  0:02   ` Marek Vasut
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2012-03-26 16:17 UTC (permalink / raw)
  To: u-boot

On 03/23/2012 06:27 PM, Marek Vasut wrote:
> GCC 4.7 error:
> cmd_nand.c: In function ?arg_off_size?:
> cmd_nand.c:216:5: warning: ?maxsize? may be used uninitialized in this function [-Wmaybe-uninitialized]

Yay, with a new compiler comes a new batch of false positives. :-P

I'm surprised it complained at line 216 but not line 208.

> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Scott Wood <scottwood@freescale.com>
> ---
>  common/cmd_nand.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> index 035a6f6..b015d11 100644
> --- a/common/cmd_nand.c
> +++ b/common/cmd_nand.c
> @@ -191,7 +191,7 @@ static int arg_off_size(int argc, char *const argv[], int *idx,
>  			loff_t *off, loff_t *size)
>  {
>  	int ret;
> -	loff_t maxsize;
> +	loff_t maxsize = 0;
>  
>  	if (argc == 0) {
>  		*off = 0;

I'll apply for next merge window.

-Scott

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] cmd_nand: Fix possible uninited max_size variable
  2012-03-26 16:17 ` Scott Wood
@ 2012-03-27  0:02   ` Marek Vasut
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2012-03-27  0:02 UTC (permalink / raw)
  To: u-boot

Dear Scott Wood,

> On 03/23/2012 06:27 PM, Marek Vasut wrote:
> > GCC 4.7 error:
> > cmd_nand.c: In function ?arg_off_size?:
> > cmd_nand.c:216:5: warning: ?maxsize? may be used uninitialized in this
> > function [-Wmaybe-uninitialized]
> 
> Yay, with a new compiler comes a new batch of false positives. :-P

And I'm the early adopter ... crusader of new compiler tests with uboot ;-D

> 
> I'm surprised it complained at line 216 but not line 208.
> 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Scott Wood <scottwood@freescale.com>
> > ---
> > 
> >  common/cmd_nand.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/common/cmd_nand.c b/common/cmd_nand.c
> > index 035a6f6..b015d11 100644
> > --- a/common/cmd_nand.c
> > +++ b/common/cmd_nand.c
> > @@ -191,7 +191,7 @@ static int arg_off_size(int argc, char *const argv[],
> > int *idx,
> > 
> >  			loff_t *off, loff_t *size)
> >  
> >  {
> >  
> >  	int ret;
> > 
> > -	loff_t maxsize;
> > +	loff_t maxsize = 0;
> > 
> >  	if (argc == 0) {
> >  	
> >  		*off = 0;
> 
> I'll apply for next merge window.
> 
> -Scott
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-27  0:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-23 23:27 [U-Boot] [PATCH] cmd_nand: Fix possible uninited max_size variable Marek Vasut
2012-03-26 16:17 ` Scott Wood
2012-03-27  0:02   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox