diff mbox series

[2/5] parser: Fix printf format warnings

Message ID 20200205094809.30185-3-ceggers@arri.de
State Accepted
Headers show
Series A bunch of build fixes | expand

Commit Message

Christian Eggers Feb. 5, 2020, 9:48 a.m. UTC
For glibc (and probably also for musl), the 'z' specifier is available
for printing (s)size_t data.

Signed-off-by: Christian Eggers <ceggers@arri.de>
---
 corelib/parsing_library.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stefano Babic Feb. 5, 2020, 10:12 a.m. UTC | #1
On 05.02.20 10:48, Christian Eggers wrote:
> For glibc (and probably also for musl), the 'z' specifier is available
> for printing (s)size_t data.
> 
> Signed-off-by: Christian Eggers <ceggers@arri.de>
> ---
>  corelib/parsing_library.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/corelib/parsing_library.c b/corelib/parsing_library.c
> index 009cd2a..be1471b 100644
> --- a/corelib/parsing_library.c
> +++ b/corelib/parsing_library.c
> @@ -215,7 +215,7 @@ bool set_find_path(const char **nodes, const char *newpath, char **tmp)
>  
>  	ref = strdup(newpath);
>  	if (!ref) {
> -		ERROR("No memory: failed for %lu bytes",
> +		ERROR("No memory: failed for %zu bytes",
>  		       strlen(newpath) + 1);
>  		return false;
>  	}
> @@ -237,7 +237,7 @@ bool set_find_path(const char **nodes, const char *newpath, char **tmp)
>  
>  	paths = calloc(count + 1, sizeof(char*) * count);
>  	if (!paths) {
> -		ERROR("No memory: calloc failed for %lu bytes",
> +		ERROR("No memory: calloc failed for %zu bytes",
>  		       sizeof(char*) * count);
>  		return false;
>  	}
> @@ -252,7 +252,7 @@ bool set_find_path(const char **nodes, const char *newpath, char **tmp)
>  
>  	ref = strdup(newpath);
>  	if (!ref) {
> -		ERROR("No memory: failed for %lu bytes",
> +		ERROR("No memory: failed for %zu bytes",
>  		       strlen(newpath) + 1);
>  		free(paths);
>  		return false;
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/corelib/parsing_library.c b/corelib/parsing_library.c
index 009cd2a..be1471b 100644
--- a/corelib/parsing_library.c
+++ b/corelib/parsing_library.c
@@ -215,7 +215,7 @@  bool set_find_path(const char **nodes, const char *newpath, char **tmp)
 
 	ref = strdup(newpath);
 	if (!ref) {
-		ERROR("No memory: failed for %lu bytes",
+		ERROR("No memory: failed for %zu bytes",
 		       strlen(newpath) + 1);
 		return false;
 	}
@@ -237,7 +237,7 @@  bool set_find_path(const char **nodes, const char *newpath, char **tmp)
 
 	paths = calloc(count + 1, sizeof(char*) * count);
 	if (!paths) {
-		ERROR("No memory: calloc failed for %lu bytes",
+		ERROR("No memory: calloc failed for %zu bytes",
 		       sizeof(char*) * count);
 		return false;
 	}
@@ -252,7 +252,7 @@  bool set_find_path(const char **nodes, const char *newpath, char **tmp)
 
 	ref = strdup(newpath);
 	if (!ref) {
-		ERROR("No memory: failed for %lu bytes",
+		ERROR("No memory: failed for %zu bytes",
 		       strlen(newpath) + 1);
 		free(paths);
 		return false;