From: Michael Jeanson Date: Wed, 14 Apr 2021 14:14:37 +0000 (-0400) Subject: fix: warnings on non-Linux platforms X-Git-Tag: v0.13.0~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a142df4e35dcf835439bf6714e49e95a2a68f7a6;p=userspace-rcu.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: I0c50dc57f71804aa544350178793bdf280a667df --- diff --git a/include/urcu/futex.h b/include/urcu/futex.h index 5e1db47..753cf16 100644 --- a/include/urcu/futex.h +++ b/include/urcu/futex.h @@ -115,7 +115,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 59ab333..9f2ed7d 100644 --- a/src/urcu-call-rcu-impl.h +++ b/src/urcu-call-rcu-impl.h @@ -230,7 +230,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 7217001..cadcf87 100644 --- a/src/workqueue.c +++ b/src/workqueue.c @@ -121,7 +121,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 cadbcb8..4fe6969 100644 --- a/tests/common/api.h +++ b/tests/common/api.h @@ -228,16 +228,20 @@ 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); CPU_SET(cpu, &mask); sched_setaffinity(0, sizeof(mask), &mask); -#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[]) {