From 412f3e8aa4b8bb9ef87617b7bd21766319e693c8 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Tue, 3 May 2022 19:41:00 +1000 Subject: [PATCH] testsuite: shmget returns an int MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stops the compilier (correctly) complaining: lib/test_shm.c: In function ‘main’: lib/test_shm.c:65:23: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘int’ [-Wformat=] 65 | printf("SHMID: %llx\n", shm_id); | ~~~^ ~~~~~~ | | | | | int | long long unsigned int shm_id is an int which is what shmget() returns. Strangely pmap has always scanned this in as a llx even though the maps "inode" column is the same number that shmget() returns. Signed-off-by: Craig Small --- lib/test_shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_shm.c b/lib/test_shm.c index 7643f7fe..49067304 100644 --- a/lib/test_shm.c +++ b/lib/test_shm.c @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) xerr(EXIT_FAILURE, "Unable to shmget()"); if ( (shm_addr = shmat(shm_id, NULL, SHM_RDONLY)) < 0) xerr(EXIT_FAILURE, "Unable to shmat()"); - printf("SHMID: %llx\n", shm_id); + printf("SHMID: %x\n", shm_id); sleep(sleep_time); return EXIT_SUCCESS; }