[PATCH i-g-t v1 2/4] runner: fixup print/scan formatting for files in runner

Kamil Konieczny kamil.konieczny at linux.intel.com
Fri May 16 15:38:07 UTC 2025


Hi Jan,
On 2025-05-16 at 11:58:09 +0000, Jan Sokolowski wrote:
> Compiling on other architectures than x86-64 causes a lot
> of print/scan formatting warnings.
> 
> Fix formatting by using proper formatters, eg. PRIu64.
> 

I do not see any PRIu64 in this patch? Only %lu replaced by %zu
where %zu stands for size_t, this is ok in executor.c
but imho not for SERIALIZE_UL

Regards,
Kamil

> Signed-off-by: Jan Sokolowski <jan.sokolowski at intel.com>
> ---
>  runner/executor.c | 2 +-
>  runner/settings.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/runner/executor.c b/runner/executor.c
> index 41f521e56..661305006 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -1582,7 +1582,7 @@ static int monitor_output(pid_t child,
>  		if (settings->disk_usage_limit && disk_usage > settings->disk_usage_limit) {
>  			char disk[1024];
>  
> -			snprintf(disk, sizeof(disk), "igt_runner: disk limit exceeded at dmesg dump, %ld > %ld\n", disk_usage, settings->disk_usage_limit);
> +			snprintf(disk, sizeof(disk), "igt_runner: disk limit exceeded at dmesg dump, %zu > %zu\n", disk_usage, settings->disk_usage_limit);
>  			if (settings->log_level >= LOG_LEVEL_NORMAL) {
>  				outf("%s", disk);
>  				fflush(stdout);
> diff --git a/runner/settings.c b/runner/settings.c
> index 1d34c5bfe..a7d5dbc97 100644
> --- a/runner/settings.c
> +++ b/runner/settings.c
> @@ -1166,7 +1166,7 @@ static ssize_t unescape_str(char *buf, size_t *n_src)
>  
>  #define SERIALIZE_LINE(f, s, name, fmt) fprintf(f, "%s : " fmt "\n", #name, s->name)
>  #define SERIALIZE_INT(f, s, name) SERIALIZE_LINE(f, s, name, "%d")
> -#define SERIALIZE_UL(f, s, name) SERIALIZE_LINE(f, s, name, "%lu")
> +#define SERIALIZE_UL(f, s, name) SERIALIZE_LINE(f, s, name, "%zu")
>  #define SERIALIZE_STR(f, s, name) do {		\
>  		if (s->name) {			\
>  			fputs(#name " : ", f);	\
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list