From: Olivier Dion Date: Tue, 15 Aug 2023 14:47:06 +0000 (-0400) Subject: ustfork: Fix warning about volatile qualifier X-Git-Url: http://git.liburcu.org/?p=lttng-ust.git;a=commitdiff_plain;h=bdc54f691b8ec841959bbc6cb2259aaf67861bdb ustfork: Fix warning about volatile qualifier Clang is strict about the volatile qualifier on function pointers. It also wants pointers to be passed to atomic builtins, even for functions. Therefore, use the addresses of function pointers even if unnecessary according to C standard. Change-Id: I5d553a46671cc4bfbe8de5cec2425201459f60d2 Signed-off-by: Olivier Dion Signed-off-by: Mathieu Desnoyers --- diff --git a/src/lib/lttng-ust-fork/ustfork.c b/src/lib/lttng-ust-fork/ustfork.c index 9508cc75..3c489fee 100644 --- a/src/lib/lttng-ust-fork/ustfork.c +++ b/src/lib/lttng-ust-fork/ustfork.c @@ -28,7 +28,7 @@ pid_t fork(void) pid_t retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "fork"); if (func == NULL) { @@ -61,7 +61,7 @@ int daemon(int nochdir, int noclose) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "daemon"); if (func == NULL) { @@ -94,7 +94,7 @@ int setuid(uid_t uid) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "setuid"); if (func == NULL) { @@ -122,7 +122,7 @@ int setgid(gid_t gid) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "setgid"); if (func == NULL) { @@ -150,7 +150,7 @@ int seteuid(uid_t euid) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "seteuid"); if (func == NULL) { @@ -178,7 +178,7 @@ int setegid(gid_t egid) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "setegid"); if (func == NULL) { @@ -206,7 +206,7 @@ int setreuid(uid_t ruid, uid_t euid) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "setreuid"); if (func == NULL) { @@ -234,7 +234,7 @@ int setregid(gid_t rgid, gid_t egid) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "setregid"); if (func == NULL) { @@ -297,7 +297,7 @@ int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ...) ctid = va_arg(ap, pid_t *); va_end(ap); - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "clone"); if (func == NULL) { @@ -338,7 +338,7 @@ int setns(int fd, int nstype) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "setns"); if (func == NULL) { @@ -366,7 +366,7 @@ int unshare(int flags) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "unshare"); if (func == NULL) { @@ -394,7 +394,7 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "setresuid"); if (func == NULL) { @@ -422,7 +422,7 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid) int retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "setresgid"); if (func == NULL) { @@ -453,7 +453,7 @@ pid_t rfork(int flags) pid_t retval; int saved_errno; - func = uatomic_read(plibc_func); + func = uatomic_read(&plibc_func); if (func == NULL) { func = dlsym(RTLD_NEXT, "rfork"); if (func == NULL) {