public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tools/kwbimage.c: fix build on m68k
@ 2014-12-03 13:07 Angelo Dureghello
  2014-12-03 13:24 ` Lukasz Majewski
  0 siblings, 1 reply; 3+ messages in thread
From: Angelo Dureghello @ 2014-12-03 13:07 UTC (permalink / raw)
  To: u-boot

Compiler still complains about headersz possible uninitialized,
even after last change (switch used).

CROSS_COMPILE=/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/
bin/m68k-linux- ./MAKEALL -a m68k
boards.cfg is up to date. Nothing to do.
Building M52277EVB board...
   text    data     bss     dec     hex filename
 118493   11756    4096  134345   20cc9 ./u-boot
tools/kwbimage.c: In function ?kwbimage_set_header?:
tools/kwbimage.c:803:8: warning: ?headersz? may be used
uninitialized in this function [-Wmaybe-uninitialized]
  memcpy(ptr, image, headersz);
                     ^

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
---
 tools/kwbimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/kwbimage.c b/tools/kwbimage.c
index c50f2e2..2c302e5 100644
--- a/tools/kwbimage.c
+++ b/tools/kwbimage.c
@@ -728,7 +728,7 @@ static void kwbimage_set_header(void *ptr, struct stat *sbuf, int ifd,
 	FILE *fcfg;
 	void *image = NULL;
 	int version;
-	size_t headersz;
+	size_t headersz = 0;
 	uint32_t checksum;
 	int ret;
 	int size;
-- 
2.1.1

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

* [U-Boot] [PATCH] tools/kwbimage.c: fix build on m68k
  2014-12-03 13:07 [U-Boot] [PATCH] tools/kwbimage.c: fix build on m68k Angelo Dureghello
@ 2014-12-03 13:24 ` Lukasz Majewski
  2014-12-03 14:45   ` Angelo Dureghello
  0 siblings, 1 reply; 3+ messages in thread
From: Lukasz Majewski @ 2014-12-03 13:24 UTC (permalink / raw)
  To: u-boot

Hi Angelo,

> Compiler still complains about headersz possible uninitialized,
> even after last change (switch used).
> 
> CROSS_COMPILE=/opt/toolchains/m68k/gcc-4.6.3-nolibc/m68k-linux/
> bin/m68k-linux- ./MAKEALL -a m68k
> boards.cfg is up to date. Nothing to do.
> Building M52277EVB board...
>    text    data     bss     dec     hex filename
>  118493   11756    4096  134345   20cc9 ./u-boot
> tools/kwbimage.c: In function ?kwbimage_set_header?:
> tools/kwbimage.c:803:8: warning: ?headersz? may be used
> uninitialized in this function [-Wmaybe-uninitialized]
>   memcpy(ptr, image, headersz);
>                      ^
> 
> Signed-off-by: Angelo Dureghello <angelo@sysam.it>
> ---
>  tools/kwbimage.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/kwbimage.c b/tools/kwbimage.c
> index c50f2e2..2c302e5 100644
> --- a/tools/kwbimage.c
> +++ b/tools/kwbimage.c
> @@ -728,7 +728,7 @@ static void kwbimage_set_header(void *ptr, struct
> stat *sbuf, int ifd, FILE *fcfg;
>  	void *image = NULL;
>  	int version;
> -	size_t headersz;
> +	size_t headersz = 0;
>  	uint32_t checksum;
>  	int ret;
>  	int size;

You aren't the first person who attempted to fix this.

Please read the following thread:
http://patchwork.ozlabs.org/patch/412968/

Albert has already promised to look into this issue.

Best regards,
Lukasz Majewski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141203/5f8e92db/attachment.pgp>

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

* [U-Boot] [PATCH] tools/kwbimage.c: fix build on m68k
  2014-12-03 13:24 ` Lukasz Majewski
@ 2014-12-03 14:45   ` Angelo Dureghello
  0 siblings, 0 replies; 3+ messages in thread
From: Angelo Dureghello @ 2014-12-03 14:45 UTC (permalink / raw)
  To: u-boot

Dear Lukasz,
> Hi Angelo,
> You aren't the first person who attempted to fix this.

i read the history of the fixes done on this file before posting,
and seen the issue was solved using a "switch / case" approach.

I was testing yesterday the kernel.org x86 toolchain for m68k,
(m68k/gcc-4.6.3-nolibc) and found this warning emitted building the
master branch,so i posted the patch since is possible the warning
is thrown only with this m68k toolchain.

So i don't want absolutely overlap ongoing jobs, if they are already
in chargeto anyone simply ignore the patch.

Best Regards,
Angelo Dureghello

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

end of thread, other threads:[~2014-12-03 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-03 13:07 [U-Boot] [PATCH] tools/kwbimage.c: fix build on m68k Angelo Dureghello
2014-12-03 13:24 ` Lukasz Majewski
2014-12-03 14:45   ` Angelo Dureghello

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