Skip to contentSkip to conversation

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

PATCH In review Martin Doucha 2 participants 2 messages May 7, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 safe_mmap(): Fix compiler warning in tst_res() format

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

---
 include/tst_safe_macros.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/tst_safe_macros.h +1 -1
index f228b99e1..8de8ef106 100644
@@ -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);
Signature · 5 lines
2.44.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Martin,

Quoted 1 line

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

Indeed. Thank you, merged.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp