Skip to contentSkip to conversation

scripts: kallsyms: Use %zu to print 'size_t'

PATCH In review Fabio Estevam 2 participants 2 messages Nov 8, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: kallsyms: Use %zu to print 'size_t'

From: Fabio Estevam <[email protected]>

Commit f3462aa95 (Kbuild: Handle longer symbols in kallsyms.c) introduced the following warning on ARM:

scripts/kallsyms.c:121:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Wformat]

Use %zu to print 'size_t'.

---
 scripts/kallsyms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/kallsyms.c +1 -1
index 11552e0..990695c 100644
@@ -116,7 +116,7 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 		return -1;
 	}
 	if (strlen(str) > KSYM_NAME_LEN) {
-		fprintf(stderr, "Symbol %s too long for kallsyms (%lu vs %d).\n"
+		fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
                                 "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
 			str, strlen(str), KSYM_NAME_LEN);
 		return -1;
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Commit f3462aa95 (Kbuild: Handle longer symbols in kallsyms.c) introduced the following warning on ARM:

scripts/kallsyms.c:121:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' [-Wformat]

Actually, every 32bit glibc seems to define size_t as unsigned int.

Quoted 4 lines

Use %zu to print 'size_t'.

Thanks, applied to kbuild.git#kbuild.

Michal