diff mbox series

tools: amlimage: include <inttypes.h>

Message ID 20260113110806.648534-1-robert.marko@sartura.hr
State Accepted
Commit 6f42057c67fad2ad66ed73b9c13347ac7881876f
Delegated to: Tom Rini
Headers show
Series tools: amlimage: include <inttypes.h> | expand

Commit Message

Robert Marko Jan. 13, 2026, 11:07 a.m. UTC
PRIuN, PRIxN, etc macros are defined in <inttypes.h>, without it being
included errors like:
tools/amlimage.c:124:38: error: expected ‘)’ before ‘PRIu8’
tools/amlimage.c:126:31: error: expected ‘)’ before ‘PRIu32’

Can be hit depending on the host compiler and HOSTCFLAGS.

Fixes: 18c1654567dc ("tools: mkimage: Add Amlogic Boot Image type")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 tools/amlimage.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Mark Kettenis Jan. 13, 2026, 12:10 p.m. UTC | #1
> From: Robert Marko <robert.marko@sartura.hr>
> Date: Tue, 13 Jan 2026 12:07:38 +0100
> 
> PRIuN, PRIxN, etc macros are defined in <inttypes.h>, without it being
> included errors like:
> tools/amlimage.c:124:38: error: expected ‘)’ before ‘PRIu8’
> tools/amlimage.c:126:31: error: expected ‘)’ before ‘PRIu32’
> 
> Can be hit depending on the host compiler and HOSTCFLAGS.
> 
> Fixes: 18c1654567dc ("tools: mkimage: Add Amlogic Boot Image type")
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> ---
>  tools/amlimage.c | 1 +
>  1 file changed, 1 insertion(+)

Hit this myself the other day on one of my systems (and then couldn't
reproduce it on another system probably because the header was pulled
in through some othet dependency).

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>

> diff --git a/tools/amlimage.c b/tools/amlimage.c
> index ecb06bc535b..bc6e19b9c24 100644
> --- a/tools/amlimage.c
> +++ b/tools/amlimage.c
> @@ -2,6 +2,7 @@
>  // Copyright Contributors to the U-Boot project.
>  
>  #include "imagetool.h"
> +#include <inttypes.h>
>  #include <u-boot/sha256.h>
>  
>  /*
> -- 
> 2.52.0
> 
>
Ferass El Hafidi Jan. 13, 2026, 6:12 p.m. UTC | #2
On Tue, 13 Jan 2026 11:07, Robert Marko <robert.marko@sartura.hr> wrote:
>PRIuN, PRIxN, etc macros are defined in <inttypes.h>, without it being
>included errors like:
>tools/amlimage.c:124:38: error: expected ‘)’ before ‘PRIu8’
>tools/amlimage.c:126:31: error: expected ‘)’ before ‘PRIu32’
>
>Can be hit depending on the host compiler and HOSTCFLAGS.
>
>Fixes: 18c1654567dc ("tools: mkimage: Add Amlogic Boot Image type")
>Signed-off-by: Robert Marko <robert.marko@sartura.hr>
>---
> tools/amlimage.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/tools/amlimage.c b/tools/amlimage.c
>index ecb06bc535b..bc6e19b9c24 100644
>--- a/tools/amlimage.c
>+++ b/tools/amlimage.c
>@@ -2,6 +2,7 @@
> // Copyright Contributors to the U-Boot project.
> 
> #include "imagetool.h"
>+#include <inttypes.h>
> #include <u-boot/sha256.h>
> 
> /*
>-- 
>2.52.0
>

Looks good to me, thanks!

Reviewed-by: Ferass El Hafidi <funderscore@postmarketos.org>

Best regards,
Ferass
Tom Rini Jan. 20, 2026, 2:31 p.m. UTC | #3
On Tue, 13 Jan 2026 12:07:38 +0100, Robert Marko wrote:

> PRIuN, PRIxN, etc macros are defined in <inttypes.h>, without it being
> included errors like:
> tools/amlimage.c:124:38: error: expected ‘)’ before ‘PRIu8’
> tools/amlimage.c:126:31: error: expected ‘)’ before ‘PRIu32’
> 
> Can be hit depending on the host compiler and HOSTCFLAGS.
> 
> [...]

Applied to u-boot/master, thanks!

[1/1] tools: amlimage: include <inttypes.h>
      commit: 6f42057c67fad2ad66ed73b9c13347ac7881876f
diff mbox series

Patch

diff --git a/tools/amlimage.c b/tools/amlimage.c
index ecb06bc535b..bc6e19b9c24 100644
--- a/tools/amlimage.c
+++ b/tools/amlimage.c
@@ -2,6 +2,7 @@ 
 // Copyright Contributors to the U-Boot project.
 
 #include "imagetool.h"
+#include <inttypes.h>
 #include <u-boot/sha256.h>
 
 /*