diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-02-06 17:08:38 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-02-06 17:08:42 +0900 |
commit | 3e75a1bb432f51f69b936342a7dc33b4f03f7204 (patch) | |
tree | e8826153a6f0fd7a37ad07c4b6beebdbaa5be753 /src/nss-mymachines | |
parent | aa18944d392f2b1894d1272767ad047be5352f99 (diff) | |
download | systemd-3e75a1bb432f51f69b936342a7dc33b4f03f7204.tar.gz |
nss-mymachines: add work-around to silence gcc warning
This is similar to 3c3d384ae93700ef08545b078c37065fdb98eee7 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)))
^
```
Diffstat (limited to 'src/nss-mymachines')
-rw-r--r-- | src/nss-mymachines/nss-mymachines.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c index b2f46e3db2..8a665cba3e 100644 --- a/src/nss-mymachines/nss-mymachines.c +++ b/src/nss-mymachines/nss-mymachines.c @@ -575,6 +575,8 @@ fail: return NSS_STATUS_UNAVAIL; } +#pragma GCC diagnostic ignored "-Wsizeof-pointer-memaccess" + enum nss_status _nss_mymachines_getgrnam_r( const char *name, struct group *gr, |