From: Michael Jeanson Date: Wed, 14 Apr 2021 14:14:37 +0000 (-0400) Subject: fix: warnings on non-Linux platforms X-Git-Tag: v0.11.4~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=04ab0de39e8a8f7c70fce56b42b8fab2d42df7ea;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/src/urcu-bp.c b/src/urcu-bp.c index ff6b3a7..8b97b70 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[]) {