[LTP] [PATCH] safe_mmap(): Fix compiler warning in tst_res() format
Martin Doucha
mdoucha@suse.cz
Tue May 7 17:52:23 CEST 2024
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(-)
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);
--
2.44.0
More information about the ltp
mailing list