Skip to content

Commit 3e75a1b

Browse files
committed
nss-mymachines: add work-around to silence gcc warning
This is similar to 3c3d384 and a workaround for the following warning. ``` In file included from ../src/basic/in-addr-util.h:28, from ../src/nss-mymachines/nss-mymachines.c:31: ../src/nss-mymachines/nss-mymachines.c: In function '_nss_mymachines_getgrnam_r': ../src/nss-mymachines/nss-mymachines.c:653:32: warning: argument to 'sizeof' in 'memset' call is the same pointer type 'char *' as the destination; expected 'char' or an explicit length [-Wsizeof-pointer-memaccess] memzero(buffer, sizeof(char*)); ^~~~ ../src/basic/util.h:118:39: note: in definition of macro 'memzero' #define memzero(x,l) (memset((x), 0, (l))) ^ ../src/nss-mymachines/nss-mymachines.c: In function '_nss_mymachines_getgrgid_r': ../src/nss-mymachines/nss-mymachines.c:730:32: warning: argument to 'sizeof' in 'memset' call is the same pointer type 'char *' as the destination; expected 'char' or an explicit length [-Wsizeof-pointer-memaccess] memzero(buffer, sizeof(char*)); ^~~~ ../src/basic/util.h:118:39: note: in definition of macro 'memzero' #define memzero(x,l) (memset((x), 0, (l))) ^ ```
1 parent aa18944 commit 3e75a1b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/nss-mymachines/nss-mymachines.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ enum nss_status _nss_mymachines_getpwuid_r(
575575
return NSS_STATUS_UNAVAIL;
576576
}
577577

578+
#pragma GCC diagnostic ignored "-Wsizeof-pointer-memaccess"
579+
578580
enum nss_status _nss_mymachines_getgrnam_r(
579581
const char *name,
580582
struct group *gr,

0 commit comments

Comments
 (0)