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:22:25 +0000 (13:22 -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

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

index ff6b3a70e151f3ef1a203f6871ac29c23a9d0697..8b97b707c74a7decf23738e5fca1f1e8e411b176 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.028205 seconds and 4 git commands to generate.