Fix three compile warnings observed when building with gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-7)
Extra token at end of #endif
[ 21%] Building C object src/common/CMakeFiles/mfu_o.dir/mfu_io.c.o
src/common/mfu_io.c:1673:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
1673 | #endif DCOPY_USE_XATTRS
| ^~~~~~~~~~~~~~~~
Implicit declaration of setgroups()
src/dcp/dcp.c:416:13: warning: implicit declaration of function ‘setgroups’; did you mean ‘getgroups’? [-Wimplicit-function-declaration]
416 | if (setgroups(0, NULL) < 0) {
| ^~~~~~~~~
| getgroups
[ 50%] Linking C executable dcp
Incorrect type passed to getgroups()
src/dcp/dcp.c:407:42: warning: passing argument 2 of ‘getgroups’ from incompatible pointer type [-Wincompatible-pointer-types]
407 | gids_count = getgroups(MAX_GIDS, &gids);
| ^~~~~
| |
| uid_t (*)[100] {aka unsigned int (*)[100]}
In file included from src/dcp/dcp.c:7:
/usr/include/unistd.h:689:43: note: expected ‘__gid_t *’ {aka ‘unsigned int *’} but argument is of type ‘uid_t (*)[100]’ {aka ‘unsigned int (*)[100]’}
689 | extern int getgroups (int __size, __gid_t __list[]) __THROW __wur;
Fix three compile warnings observed when building with gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-7)
Extra token at end of
#endif
Implicit declaration of
setgroups()
Incorrect type passed to
getgroups()