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 17:21:16 +0000 (13:21 -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: Icb2b71345f9e67fe5b10d96f883b1f599d2b6bb9

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 f720cdc0db52ed41cd391bec9b570464492a026e..e89d319089fb894b1455b7d4cbaebf0888d76c32 100644 (file)
@@ -110,7 +110,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 a3018bacc0cdd7dc52085189481482483bfa3ffd..a9c0e4d55b106b2f00c6f9da2638778b2a7f4240 100644 (file)
@@ -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;
 }
index c2c9b9c57417855d8b48f85adbcbed9c6cb6bab6..94bd514c59f365cca9a846619310d698e3c312aa 100644 (file)
@@ -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;
 }
index 32d594a11350e38e7edcff3da6660b6852be75a9..e5c70abc0926660efd6cc39ccd2d192250844f20 100644 (file)
@@ -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...
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.03393 seconds and 4 git commands to generate.