* [PATCH] tools: image-host.c: use correct output format
@ 2020-10-08 18:51 Heinrich Schuchardt
2020-10-12 3:34 ` Simon Glass
2020-10-23 0:28 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-10-08 18:51 UTC (permalink / raw)
To: u-boot
When building on a 32bit host the following warning occurs:
tools/image-host.c: In function ?fit_image_read_data?:
tools/image-host.c:296:56: warning: format ?%ld? expects argument of
type ?long int?, but argument 3 has type ?__off64_t?
{aka ?long long int?} [-Wformat=]
printf("File %s don't have the expected size (size=%ld, expected=%d)\n",
~~^
%lld
filename, sbuf.st_size, expected_size);
~~~~~~~~~~~~
tools/image-host.c:311:62: warning: format ?%ld? expects argument of
type ?long int?, but argument 4 has type ?__off64_t?
{aka ?long long int?} [-Wformat=]
printf("Can't read all file %s (read %zd bytes, expexted %ld)\n",
~~^
%lld
filename, n, sbuf.st_size);
~~~~~~~~~~~~
Fix the format strings.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
tools/image-host.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/image-host.c b/tools/image-host.c
index 9a83b7f675..10e66cdaa2 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -293,8 +293,8 @@ static int fit_image_read_data(char *filename, unsigned char *data,
/* Check file size */
if (sbuf.st_size != expected_size) {
- printf("File %s don't have the expected size (size=%ld, expected=%d)\n",
- filename, sbuf.st_size, expected_size);
+ printf("File %s don't have the expected size (size=%lld, expected=%d)\n",
+ filename, (long long)sbuf.st_size, expected_size);
goto err;
}
@@ -308,8 +308,8 @@ static int fit_image_read_data(char *filename, unsigned char *data,
/* Check that we have read all the file */
if (n != sbuf.st_size) {
- printf("Can't read all file %s (read %zd bytes, expexted %ld)\n",
- filename, n, sbuf.st_size);
+ printf("Can't read all file %s (read %zd bytes, expexted %lld)\n",
+ filename, n, (long long)sbuf.st_size);
goto err;
}
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] tools: image-host.c: use correct output format
2020-10-08 18:51 [PATCH] tools: image-host.c: use correct output format Heinrich Schuchardt
@ 2020-10-12 3:34 ` Simon Glass
2020-10-23 0:28 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-10-12 3:34 UTC (permalink / raw)
To: u-boot
On Thu, 8 Oct 2020 at 12:51, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> When building on a 32bit host the following warning occurs:
>
> tools/image-host.c: In function ?fit_image_read_data?:
> tools/image-host.c:296:56: warning: format ?%ld? expects argument of
> type ?long int?, but argument 3 has type ?__off64_t?
> {aka ?long long int?} [-Wformat=]
> printf("File %s don't have the expected size (size=%ld, expected=%d)\n",
> ~~^
> %lld
> filename, sbuf.st_size, expected_size);
> ~~~~~~~~~~~~
> tools/image-host.c:311:62: warning: format ?%ld? expects argument of
> type ?long int?, but argument 4 has type ?__off64_t?
> {aka ?long long int?} [-Wformat=]
> printf("Can't read all file %s (read %zd bytes, expexted %ld)\n",
> ~~^
> %lld
> filename, n, sbuf.st_size);
> ~~~~~~~~~~~~
>
> Fix the format strings.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> tools/image-host.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] tools: image-host.c: use correct output format
2020-10-08 18:51 [PATCH] tools: image-host.c: use correct output format Heinrich Schuchardt
2020-10-12 3:34 ` Simon Glass
@ 2020-10-23 0:28 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2020-10-23 0:28 UTC (permalink / raw)
To: u-boot
On Thu, Oct 08, 2020 at 08:51:24PM +0200, Heinrich Schuchardt wrote:
> When building on a 32bit host the following warning occurs:
>
> tools/image-host.c: In function ?fit_image_read_data?:
> tools/image-host.c:296:56: warning: format ?%ld? expects argument of
> type ?long int?, but argument 3 has type ?__off64_t?
> {aka ?long long int?} [-Wformat=]
> printf("File %s don't have the expected size (size=%ld, expected=%d)\n",
> ~~^
> %lld
> filename, sbuf.st_size, expected_size);
> ~~~~~~~~~~~~
> tools/image-host.c:311:62: warning: format ?%ld? expects argument of
> type ?long int?, but argument 4 has type ?__off64_t?
> {aka ?long long int?} [-Wformat=]
> printf("Can't read all file %s (read %zd bytes, expexted %ld)\n",
> ~~^
> %lld
> filename, n, sbuf.st_size);
> ~~~~~~~~~~~~
>
> Fix the format strings.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201022/356b1f9f/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-23 0:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08 18:51 [PATCH] tools: image-host.c: use correct output format Heinrich Schuchardt
2020-10-12 3:34 ` Simon Glass
2020-10-23 0:28 ` Tom Rini
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.