From: Michael Jeanson Date: Wed, 14 Apr 2021 14:14:37 +0000 (-0400) Subject: fix: warnings on non-Linux platforms X-Git-Tag: v0.12.3~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0d657320a24b17ad7762396c5ef5db3640262af4;p=urcu.git fix: warnings on non-Linux platforms Add the relevent attributes in non-Linux wrapper code. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: Icb2b71345f9e67fe5b10d96f883b1f599d2b6bb9 --- diff --git a/include/urcu/futex.h b/include/urcu/futex.h index f720cdc..e89d319 100644 --- a/include/urcu/futex.h +++ b/include/urcu/futex.h @@ -110,7 +110,9 @@ static inline int futex_async(int32_t *uaddr, int op, int32_t val, #include static inline int futex_async(int32_t *uaddr, int op, int32_t val, - const struct timespec *timeout, int32_t *uaddr2, int32_t val3) + const struct timespec *timeout, + int32_t *uaddr2 __attribute__((unused)), + int32_t val3 __attribute__((unused))) { int umtx_op; void *umtx_uaddr = NULL, *umtx_uaddr2 = NULL; diff --git a/src/urcu-bp.c b/src/urcu-bp.c index c2ac792..671becb 100644 --- a/src/urcu-bp.c +++ b/src/urcu-bp.c @@ -75,8 +75,10 @@ void *mremap_wrapper(void *old_address, size_t old_size, * This is not generic. */ static -void *mremap_wrapper(void *old_address, size_t old_size, - size_t new_size, int flags) +void *mremap_wrapper(void *old_address __attribute__((unused)), + size_t old_size __attribute__((unused)), + size_t new_size __attribute__((unused)), + int flags) { assert(!(flags & MREMAP_MAYMOVE)); diff --git a/src/urcu-call-rcu-impl.h b/src/urcu-call-rcu-impl.h index a3018ba..a9c0e4d 100644 --- a/src/urcu-call-rcu-impl.h +++ b/src/urcu-call-rcu-impl.h @@ -233,7 +233,7 @@ int set_thread_cpu_affinity(struct call_rcu_data *crdp) } #else static -int set_thread_cpu_affinity(struct call_rcu_data *crdp) +int set_thread_cpu_affinity(struct call_rcu_data *crdp __attribute__((unused))) { return 0; } diff --git a/src/workqueue.c b/src/workqueue.c index c2c9b9c..94bd514 100644 --- a/src/workqueue.c +++ b/src/workqueue.c @@ -124,7 +124,7 @@ static int set_thread_cpu_affinity(struct urcu_workqueue *workqueue) return ret; } #else -static int set_thread_cpu_affinity(struct urcu_workqueue *workqueue) +static int set_thread_cpu_affinity(struct urcu_workqueue *workqueue __attribute__((unused))) { return 0; } diff --git a/tests/common/api.h b/tests/common/api.h index 32d594a..e5c70ab 100644 --- a/tests/common/api.h +++ b/tests/common/api.h @@ -229,9 +229,9 @@ static void wait_all_threads(void) } } +#ifdef HAVE_SCHED_SETAFFINITY static void run_on(int cpu) { -#ifdef HAVE_SCHED_SETAFFINITY cpu_set_t mask; CPU_ZERO(&mask); @@ -241,8 +241,12 @@ static void run_on(int cpu) #else sched_setaffinity(0, sizeof(mask), &mask); #endif -#endif /* HAVE_SCHED_SETAFFINITY */ } +#else + +static void run_on(int cpu __attribute__((unused))) +{} +#endif /* HAVE_SCHED_SETAFFINITY */ /* * timekeeping -- very crude -- should use MONOTONIC... diff --git a/tests/regression/rcutorture.h b/tests/regression/rcutorture.h index 0c5c895..ac5348c 100644 --- a/tests/regression/rcutorture.h +++ b/tests/regression/rcutorture.h @@ -531,6 +531,9 @@ int stresstest(int nreaders) * Mainprogram. */ +static +void usage(char *argv[]) __attribute__((noreturn)); + static void usage(char *argv[]) {