diff mbox series

safe_mmap(): Fix compiler warning in tst_res() format

Message ID 20240507155225.14126-1-mdoucha@suse.cz
State Accepted
Headers show
Series safe_mmap(): Fix compiler warning in tst_res() format | expand

Commit Message

Martin Doucha May 7, 2024, 3:52 p.m. UTC
The length variable has type size_t so the appropriate format is %zu.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 include/tst_safe_macros.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Petr Vorel May 7, 2024, 4:59 p.m. UTC | #1
Hi Martin,

> The length variable has type size_t so the appropriate format is %zu.

Indeed. Thank you, merged.

Kind regards,
Petr
diff mbox series

Patch

diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h
index f228b99e1..8de8ef106 100644
--- a/include/tst_safe_macros.h
+++ b/include/tst_safe_macros.h
@@ -281,7 +281,7 @@  static inline void *safe_mmap(const char *file, const int lineno,
 	tst_prot_to_str(prot, prot_buf);
 
 	tst_res_(file, lineno, TDEBUG,
-		"mmap(%p, %ld, %s(%x), %d, %d, %ld)",
+		"mmap(%p, %zu, %s(%x), %d, %d, %ld)",
 		addr, length, prot_buf, prot, flags, fd, offset);
 
 	rval = mmap(addr, length, prot, flags, fd, offset);