fix: warnings on non-Linux platforms
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 14 Apr 2021 14:14:37 +0000 (10:14 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Apr 2021 12:26:17 +0000 (08:26 -0400)
Add the relevent attributes in non-Linux wrapper code.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I0c50dc57f71804aa544350178793bdf280a667df

include/urcu/futex.h
src/urcu-bp.c
src/urcu-call-rcu-impl.h
src/workqueue.c
tests/common/api.h
tests/regression/rcutorture.h

index 5e1db47af709026a6a4a25f5e1bbedfd6e58d0e0..753cf16d9e28d6c79639e915fd633175121c0315 100644 (file)
@@ -115,7 +115,9 @@ static inline int futex_async(int32_t *uaddr, int op, int32_t val,
 #include <sys/umtx.h>
 
 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;
index c2ac792c219f825936e1e3676907e8b8cf9ea01a..671becb0e14644c6eeb37270ab154f1b95877549 100644 (file)
@@ -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));
 
index 59ab333051bd9b1f624904280a52b344d26d25f4..9f2ed7dd709263f3eaa8418d7562a7ec91c993b6 100644 (file)
@@ -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;
 }
index 72170012eafc2fb925f885b9a666be610901ec3f..cadcf874be6c76726dc1a3dd3e082c545b266e8b 100644 (file)
@@ -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;
 }
index cadbcb89070fbf696962f0aff9d6cfe21ba764e1..4fe6969f424652e5d18081ae285d621c74d785e4 100644 (file)
@@ -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...
index 0c5c8956e982245b5b1c4406f9455c2d72411b1d..ac5348cd465f004179839b14986e91e0781d7125 100644 (file)
@@ -531,6 +531,9 @@ int stresstest(int nreaders)
  * Mainprogram.
  */
 
+static
+void usage(char *argv[]) __attribute__((noreturn));
+
 static
 void usage(char *argv[])
 {
This page took 0.039696 seconds and 4 git commands to generate.