[PATCH] tools: image-host.c: use correct output format

Simon Glass sjg at chromium.org
Mon Oct 12 05:34:58 CEST 2020


On Thu, 8 Oct 2020 at 12:51, Heinrich Schuchardt <xypron.glpk at 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 at gmx.de>
> ---
>  tools/image-host.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list