From bd9abebd9fdc124bdb72e22c9de261d83acda0a5 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 26 Feb 2012 00:00:11 +0100 Subject: [PATCH] pmap: fix compiler format warnings pmap.c: In function 'discover_shm_minor': pmap.c:87:10: warning: ISO C does not support the '%Lx' gnu_scanf format [-Wformat] pmap.c:87:10: warning: ISO C does not support the '%Lu' gnu_scanf format [-Wformat] pmap.c: In function 'mapping_name': pmap.c:128:3: warning: ISO C does not support the '%Lx' gnu_printf format [-Wformat] pmap.c:128:3: warning: ISO C does not support the '%Lx' gnu_printf format [-Wformat] pmap.c: In function 'one_proc': pmap.c:265:10: warning: ISO C does not support the '%Lx' gnu_scanf format [-Wformat] pmap.c:265:10: warning: ISO C does not support the '%Lu' gnu_scanf format [-Wformat] pmap.c:315:11: warning: ISO C does not support the '%Lx' gnu_printf format [-Wformat] Signed-off-by: Sami Kerola --- pmap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pmap.c b/pmap.c index df052e92..88f1bf1f 100644 --- a/pmap.c +++ b/pmap.c @@ -82,7 +82,7 @@ static void discover_shm_minor(void) unsigned KLONG start, end; unsigned long long file_offset, inode; unsigned dev_major, dev_minor; - sscanf(mapbuf, "%" KLF "x-%" KLF "x %31s %Lx %x:%x %Lu", &start, + sscanf(mapbuf, "%" KLF "x-%" KLF "x %31s %llx %x:%x %llu", &start, &end, flags, &file_offset, &dev_major, &dev_minor, &inode); tmp = strchr(mapbuf, '\n'); @@ -125,7 +125,7 @@ static char *mapping_name(proc_t * p, unsigned KLONG addr, if (!dev_major && dev_minor == shm_minor && strstr(mapbuf, "/SYSV")) { static char shmbuf[64]; - snprintf(shmbuf, sizeof shmbuf, " [ shmid=0x%Lx ]", inode); + snprintf(shmbuf, sizeof shmbuf, " [ shmid=0x%llx ]", inode); return shmbuf; } @@ -260,7 +260,7 @@ static int one_proc(proc_t * p) continue; } } - sscanf(mapbuf, "%" KLF "x-%" KLF "x %31s %Lx %x:%x %Lu", &start, + sscanf(mapbuf, "%" KLF "x-%" KLF "x %31s %llx %x:%x %llu", &start, &end, flags, &file_offset, &dev_major, &dev_minor, &inode); @@ -308,8 +308,8 @@ static int one_proc(proc_t * p) mapping_name(p, start, diff, mapbuf, 0, dev_major, dev_minor, inode); printf((sizeof(KLONG) == 8) - ? "%016" KLF "x %7lu %s %016Lx %03x:%05x %s\n" - : "%08lx %7lu %s %016Lx %03x:%05x %s\n", + ? "%016" KLF "x %7lu %s %016llx %03x:%05x %s\n" + : "%08lx %7lu %s %016llx %03x:%05x %s\n", start, (unsigned long)(diff >> 10), flags, file_offset, dev_major, dev_minor, cp); -- 2.40.0