From 2fcff93d20a717be95dcde5a3ab690db9724626a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 3 Aug 2019 08:41:55 -0600 Subject: [PATCH] libs/libc/grp/lib_grp.c: Fix a warning when compiling on a 64-bit simulation. Cannot cast a pointer to unsigned in that case because unsigned (int) is only 32-bits, but the pointer is 64-bits. --- libs/libc/grp/lib_grp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libc/grp/lib_grp.c b/libs/libc/grp/lib_grp.c index 88f5e3c165..c6b48d8606 100644 --- a/libs/libc/grp/lib_grp.c +++ b/libs/libc/grp/lib_grp.c @@ -161,7 +161,7 @@ int getgrbuf_r(gid_t gid, FAR const char *name, FAR const char *passwd, * sufficient buffer space was supplied by the caller. */ - padlen = sizeof(FAR void *) - ((unsigned)buf % sizeof(FAR char *)); + padlen = sizeof(FAR void *) - ((uintptr_t)buf % sizeof(FAR char *)); reqdlen = sizeof(FAR void *) + strlen(name) + 1 + strlen(passwd) + 1; if (buflen < padlen + reqdlen)