All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] tools/atmelimage.c: Fix warning when debug is enabled
Date: Thu, 27 Aug 2015 12:37:52 +0200	[thread overview]
Message-ID: <55DEE880.6060205@gmail.com> (raw)
In-Reply-To: <1440616883-20885-1-git-send-email-trini@konsulko.com>

Hi Tom,

On 08/26/2015 09:21 PM, Tom Rini wrote:
> Otherwise we get:
> tools/atmelimage.c:134:3: warning: format ?%d? expects argument of type ?int?, but argument 2 has type ?size_t? [-Wformat=]
> debug("atmelimage: interrupt vector #%d is 0x%08X\n", pos+1,
> ^
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  tools/atmelimage.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/atmelimage.c b/tools/atmelimage.c
> index 5b72ac5..0979eef 100644
> --- a/tools/atmelimage.c
> +++ b/tools/atmelimage.c
> @@ -131,7 +131,7 @@ static int atmel_verify_header(unsigned char *ptr, int image_size,
>  
>  	/* check the seven interrupt vectors of binary */
>  	for (pos = 0; pos < 7; pos++) {
> -		debug("atmelimage: interrupt vector #%d is 0x%08X\n", pos+1,
> +		debug("atmelimage: interrupt vector #%ld is 0x%08X\n", pos+1,

I'd rather use the '%zu' modifier here. On 32 Bit systems the size_t
might be a simple int and not a long int which also leads to warnings.

Andreas

>  		      ints[pos]);
>  		/*
>  		 * all vectors except the 6'th one must contain valid
> 

  parent reply	other threads:[~2015-08-27 10:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 19:21 [U-Boot] [PATCH 1/2] tools/atmelimage.c: Fix warning when debug is enabled Tom Rini
2015-08-26 19:21 ` [U-Boot] [PATCH 2/2] tools/mkimage.c: Clarify help text for -D slightly Tom Rini
2015-10-12 15:15   ` [U-Boot] [U-Boot, " Tom Rini
2015-08-27 10:37 ` Andreas Bießmann [this message]
2015-08-27 11:26   ` [U-Boot] [PATCH 1/2] tools/atmelimage.c: Fix warning when debug is enabled Tom Rini
     [not found] ` <1440698088-1152-1-git-send-email-trini@konsulko.com>
2015-08-28  7:20   ` [U-Boot] [PATCH v2 " Andreas Bießmann
2015-08-28 21:05     ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55DEE880.6060205@gmail.com \
    --to=andreas.devel@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.