From: Michael Jeanson Date: Thu, 1 Apr 2021 18:39:01 +0000 (-0400) Subject: cleanup: explicitly mark unused parameters (-Wunused-parameter) X-Git-Tag: v0.12.3~20 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=17a8f206ce5461b5a0a551171493b5b63e592f86;p=userspace-rcu.git cleanup: explicitly mark unused parameters (-Wunused-parameter) Add the 'unused' attribute to function parameters that are unused to allow turning on -Wunused-parameter and distinguish unused parameters that are actual errors. Change-Id: Ie585e37f9d38718543a31aee2e7ab3428cdfd0a5 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/doc/examples/hlist/cds_hlist_add_head_rcu.c b/doc/examples/hlist/cds_hlist_add_head_rcu.c index bfe71c4..3aece5e 100644 --- a/doc/examples/hlist/cds_hlist_add_head_rcu.c +++ b/doc/examples/hlist/cds_hlist_add_head_rcu.c @@ -28,7 +28,7 @@ struct mynode { struct cds_hlist_node node; /* Linked-list chaining */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_HLIST_HEAD(mylist); /* Defines an empty hlist head */ diff --git a/doc/examples/hlist/cds_hlist_del_rcu.c b/doc/examples/hlist/cds_hlist_del_rcu.c index 2c0008e..28b6c42 100644 --- a/doc/examples/hlist/cds_hlist_del_rcu.c +++ b/doc/examples/hlist/cds_hlist_del_rcu.c @@ -37,7 +37,7 @@ void free_node_rcu(struct rcu_head *head) free(node); } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_HLIST_HEAD(mylist); /* Defines an empty hlist head */ diff --git a/doc/examples/hlist/cds_hlist_for_each_entry_rcu.c b/doc/examples/hlist/cds_hlist_for_each_entry_rcu.c index 5f8fa72..1be4ac5 100644 --- a/doc/examples/hlist/cds_hlist_for_each_entry_rcu.c +++ b/doc/examples/hlist/cds_hlist_for_each_entry_rcu.c @@ -28,7 +28,7 @@ struct mynode { struct cds_hlist_node node; /* Linked-list chaining */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_HLIST_HEAD(mylist); /* Defines an empty hlist head */ diff --git a/doc/examples/hlist/cds_hlist_for_each_rcu.c b/doc/examples/hlist/cds_hlist_for_each_rcu.c index fe31b54..1628c66 100644 --- a/doc/examples/hlist/cds_hlist_for_each_rcu.c +++ b/doc/examples/hlist/cds_hlist_for_each_rcu.c @@ -31,7 +31,7 @@ struct mynode { struct cds_hlist_node node; /* Linked-list chaining */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_HLIST_HEAD(mylist); /* Defines an empty hlist head */ diff --git a/doc/examples/lfstack/cds_lfs_pop_all_blocking.c b/doc/examples/lfstack/cds_lfs_pop_all_blocking.c index 1aaffb0..f6fcfb7 100644 --- a/doc/examples/lfstack/cds_lfs_pop_all_blocking.c +++ b/doc/examples/lfstack/cds_lfs_pop_all_blocking.c @@ -27,7 +27,7 @@ struct mynode { struct cds_lfs_node node; /* Chaining in stack */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_lfs_stack mystack; /* Stack */ diff --git a/doc/examples/lfstack/cds_lfs_pop_blocking.c b/doc/examples/lfstack/cds_lfs_pop_blocking.c index 68c17e4..f356423 100644 --- a/doc/examples/lfstack/cds_lfs_pop_blocking.c +++ b/doc/examples/lfstack/cds_lfs_pop_blocking.c @@ -27,7 +27,7 @@ struct mynode { struct cds_lfs_node node; /* Chaining in stack */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_lfs_stack mystack; /* Stack */ diff --git a/doc/examples/lfstack/cds_lfs_push.c b/doc/examples/lfstack/cds_lfs_push.c index 3b048f4..bdb160f 100644 --- a/doc/examples/lfstack/cds_lfs_push.c +++ b/doc/examples/lfstack/cds_lfs_push.c @@ -27,7 +27,7 @@ struct mynode { struct cds_lfs_node node; /* Chaining in stack */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_lfs_stack mystack; /* Stack */ diff --git a/doc/examples/list/cds_list_add_rcu.c b/doc/examples/list/cds_list_add_rcu.c index 4235d25..3eb062a 100644 --- a/doc/examples/list/cds_list_add_rcu.c +++ b/doc/examples/list/cds_list_add_rcu.c @@ -28,7 +28,7 @@ struct mynode { struct cds_list_head node; /* Linked-list chaining */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_LIST_HEAD(mylist); /* Defines an empty list head */ diff --git a/doc/examples/list/cds_list_add_tail_rcu.c b/doc/examples/list/cds_list_add_tail_rcu.c index 653da6c..f7490af 100644 --- a/doc/examples/list/cds_list_add_tail_rcu.c +++ b/doc/examples/list/cds_list_add_tail_rcu.c @@ -28,7 +28,7 @@ struct mynode { struct cds_list_head node; /* Linked-list chaining */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_LIST_HEAD(mylist); /* Defines an empty list head */ diff --git a/doc/examples/list/cds_list_del_rcu.c b/doc/examples/list/cds_list_del_rcu.c index 1f4265c..d6b3ab0 100644 --- a/doc/examples/list/cds_list_del_rcu.c +++ b/doc/examples/list/cds_list_del_rcu.c @@ -37,7 +37,7 @@ void free_node_rcu(struct rcu_head *head) free(node); } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_LIST_HEAD(mylist); /* Defines an empty list head */ diff --git a/doc/examples/list/cds_list_for_each_entry_rcu.c b/doc/examples/list/cds_list_for_each_entry_rcu.c index 6e4f7d6..5deb4a5 100644 --- a/doc/examples/list/cds_list_for_each_entry_rcu.c +++ b/doc/examples/list/cds_list_for_each_entry_rcu.c @@ -28,7 +28,7 @@ struct mynode { struct cds_list_head node; /* Linked-list chaining */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_LIST_HEAD(mylist); /* Defines an empty list head */ diff --git a/doc/examples/list/cds_list_for_each_rcu.c b/doc/examples/list/cds_list_for_each_rcu.c index 12d5c4d..2e66719 100644 --- a/doc/examples/list/cds_list_for_each_rcu.c +++ b/doc/examples/list/cds_list_for_each_rcu.c @@ -30,7 +30,7 @@ struct mynode { struct cds_list_head node; /* Linked-list chaining */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_LIST_HEAD(mylist); /* Defines an empty list head */ diff --git a/doc/examples/list/cds_list_replace_rcu.c b/doc/examples/list/cds_list_replace_rcu.c index 39202ea..aa6161c 100644 --- a/doc/examples/list/cds_list_replace_rcu.c +++ b/doc/examples/list/cds_list_replace_rcu.c @@ -37,7 +37,7 @@ void free_node_rcu(struct rcu_head *head) free(node); } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; CDS_LIST_HEAD(mylist); /* Defines an empty list head */ diff --git a/doc/examples/rculfhash/cds_lfht_add.c b/doc/examples/rculfhash/cds_lfht_add.c index acff676..67b00f4 100644 --- a/doc/examples/rculfhash/cds_lfht_add.c +++ b/doc/examples/rculfhash/cds_lfht_add.c @@ -32,7 +32,7 @@ struct mynode { struct cds_lfht_node node; /* Chaining in hash table */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 42, 36, 24, }; /* 42 is duplicated */ struct cds_lfht *ht; /* Hash table */ diff --git a/doc/examples/rculfhash/cds_lfht_add_replace.c b/doc/examples/rculfhash/cds_lfht_add_replace.c index 3b64ee0..363ea5b 100644 --- a/doc/examples/rculfhash/cds_lfht_add_replace.c +++ b/doc/examples/rculfhash/cds_lfht_add_replace.c @@ -54,7 +54,7 @@ void free_node(struct rcu_head *head) free(node); } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 42, 36, 24, }; /* 42 is duplicated */ struct cds_lfht *ht; /* Hash table */ diff --git a/doc/examples/rculfhash/cds_lfht_add_unique.c b/doc/examples/rculfhash/cds_lfht_add_unique.c index 23b29f2..d6044c2 100644 --- a/doc/examples/rculfhash/cds_lfht_add_unique.c +++ b/doc/examples/rculfhash/cds_lfht_add_unique.c @@ -43,7 +43,7 @@ int match(struct cds_lfht_node *ht_node, const void *_key) return *key == node->value; } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 42, 36, 24, }; /* 42 is duplicated */ struct cds_lfht *ht; /* Hash table */ diff --git a/doc/examples/rculfhash/cds_lfht_del.c b/doc/examples/rculfhash/cds_lfht_del.c index f030ee1..9dab8a5 100644 --- a/doc/examples/rculfhash/cds_lfht_del.c +++ b/doc/examples/rculfhash/cds_lfht_del.c @@ -50,7 +50,7 @@ void free_node(struct rcu_head *head) free(node); } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 42, 36, 24, }; /* 42 is duplicated */ int remove_values[] = { 42, 36, 24, 123, }; diff --git a/doc/examples/rculfhash/cds_lfht_destroy.c b/doc/examples/rculfhash/cds_lfht_destroy.c index 1c723a5..56b9df6 100644 --- a/doc/examples/rculfhash/cds_lfht_destroy.c +++ b/doc/examples/rculfhash/cds_lfht_destroy.c @@ -41,7 +41,7 @@ void free_node(struct rcu_head *head) free(node); } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 42, 36, 24, }; /* 42 is duplicated */ struct cds_lfht *ht; /* Hash table */ diff --git a/doc/examples/rculfhash/cds_lfht_for_each_entry_duplicate.c b/doc/examples/rculfhash/cds_lfht_for_each_entry_duplicate.c index a975128..00ebfa1 100644 --- a/doc/examples/rculfhash/cds_lfht_for_each_entry_duplicate.c +++ b/doc/examples/rculfhash/cds_lfht_for_each_entry_duplicate.c @@ -42,7 +42,7 @@ int match(struct cds_lfht_node *ht_node, const void *_key) return *key == node->value; } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 42, 36, 24, }; /* 42 is duplicated */ int lookup_values[] = { 42, 200, 36, }; diff --git a/doc/examples/rculfhash/cds_lfht_lookup.c b/doc/examples/rculfhash/cds_lfht_lookup.c index de2a47f..8eeacf7 100644 --- a/doc/examples/rculfhash/cds_lfht_lookup.c +++ b/doc/examples/rculfhash/cds_lfht_lookup.c @@ -42,7 +42,7 @@ int match(struct cds_lfht_node *ht_node, const void *_key) return *key == node->value; } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 42, 36, 24, }; /* 42 is duplicated */ int lookup_values[] = { 42, 200, 36, }; diff --git a/doc/examples/rculfqueue/cds_lfq_dequeue.c b/doc/examples/rculfqueue/cds_lfq_dequeue.c index fc8053c..e81e105 100644 --- a/doc/examples/rculfqueue/cds_lfq_dequeue.c +++ b/doc/examples/rculfqueue/cds_lfq_dequeue.c @@ -39,7 +39,7 @@ void free_node(struct rcu_head *head) free(node); } -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_lfq_queue_rcu myqueue; /* Queue */ diff --git a/doc/examples/rculfqueue/cds_lfq_enqueue.c b/doc/examples/rculfqueue/cds_lfq_enqueue.c index 1e78f16..1202467 100644 --- a/doc/examples/rculfqueue/cds_lfq_enqueue.c +++ b/doc/examples/rculfqueue/cds_lfq_enqueue.c @@ -29,7 +29,7 @@ struct mynode { struct cds_lfq_node_rcu node; /* Chaining in queue */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_lfq_queue_rcu myqueue; /* Queue */ diff --git a/doc/examples/urcu-flavors/bp.c b/doc/examples/urcu-flavors/bp.c index 1875a86..9032b9b 100644 --- a/doc/examples/urcu-flavors/bp.c +++ b/doc/examples/urcu-flavors/bp.c @@ -54,7 +54,7 @@ int add_node(uint64_t v) return 0; } -int main(int argc, char **argv) +int main(void) { uint64_t values[] = { 42, 36, 24, }; unsigned int i; diff --git a/doc/examples/urcu-flavors/mb.c b/doc/examples/urcu-flavors/mb.c index e103e4f..5280598 100644 --- a/doc/examples/urcu-flavors/mb.c +++ b/doc/examples/urcu-flavors/mb.c @@ -63,7 +63,7 @@ void rcu_free_node(struct rcu_head *rh) free(node); } -int main(int argc, char **argv) +int main(void) { uint64_t values[] = { 42, 36, 24, }; unsigned int i; diff --git a/doc/examples/urcu-flavors/membarrier.c b/doc/examples/urcu-flavors/membarrier.c index f9523d5..2e84734 100644 --- a/doc/examples/urcu-flavors/membarrier.c +++ b/doc/examples/urcu-flavors/membarrier.c @@ -63,7 +63,7 @@ void rcu_free_node(struct rcu_head *rh) free(node); } -int main(int argc, char **argv) +int main(void) { uint64_t values[] = { 42, 36, 24, }; unsigned int i; diff --git a/doc/examples/urcu-flavors/qsbr.c b/doc/examples/urcu-flavors/qsbr.c index 7af8ada..661ecae 100644 --- a/doc/examples/urcu-flavors/qsbr.c +++ b/doc/examples/urcu-flavors/qsbr.c @@ -62,7 +62,7 @@ void rcu_free_node(struct rcu_head *rh) free(node); } -int main(int argc, char **argv) +int main(void) { uint64_t values[] = { 42, 36, 24, }; unsigned int i; diff --git a/doc/examples/urcu-flavors/signal.c b/doc/examples/urcu-flavors/signal.c index e396b9e..c0a35b9 100644 --- a/doc/examples/urcu-flavors/signal.c +++ b/doc/examples/urcu-flavors/signal.c @@ -62,7 +62,7 @@ void rcu_free_node(struct rcu_head *rh) free(node); } -int main(int argc, char **argv) +int main(void) { uint64_t values[] = { 42, 36, 24, }; unsigned int i; diff --git a/doc/examples/wfcqueue/cds_wfcq_dequeue.c b/doc/examples/wfcqueue/cds_wfcq_dequeue.c index 742a686..41a7baa 100644 --- a/doc/examples/wfcqueue/cds_wfcq_dequeue.c +++ b/doc/examples/wfcqueue/cds_wfcq_dequeue.c @@ -27,7 +27,7 @@ struct mynode { struct cds_wfcq_node node; /* Chaining in queue */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_wfcq_head myqueue_head; /* Queue head */ diff --git a/doc/examples/wfcqueue/cds_wfcq_enqueue.c b/doc/examples/wfcqueue/cds_wfcq_enqueue.c index cfc9963..850eea8 100644 --- a/doc/examples/wfcqueue/cds_wfcq_enqueue.c +++ b/doc/examples/wfcqueue/cds_wfcq_enqueue.c @@ -27,7 +27,7 @@ struct mynode { struct cds_wfcq_node node; /* Chaining in queue */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_wfcq_head myqueue_head; /* Queue head */ diff --git a/doc/examples/wfcqueue/cds_wfcq_splice.c b/doc/examples/wfcqueue/cds_wfcq_splice.c index f11edcb..cb6f76b 100644 --- a/doc/examples/wfcqueue/cds_wfcq_splice.c +++ b/doc/examples/wfcqueue/cds_wfcq_splice.c @@ -69,7 +69,7 @@ void print_queue(struct cds_wfcq_head *head, printf("\n"); } -int main(int argc, char **argv) +int main(void) { int values_A[] = { -5, 42, 36, 24, }; int values_B[] = { 200, 300, 400, }; diff --git a/doc/examples/wfstack/cds_wfs_pop.c b/doc/examples/wfstack/cds_wfs_pop.c index 09edd3d..68b81b9 100644 --- a/doc/examples/wfstack/cds_wfs_pop.c +++ b/doc/examples/wfstack/cds_wfs_pop.c @@ -27,7 +27,7 @@ struct mynode { struct cds_wfs_node node; /* Chaining in stack */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_wfs_stack mystack; /* Stack */ diff --git a/doc/examples/wfstack/cds_wfs_pop_all_blocking.c b/doc/examples/wfstack/cds_wfs_pop_all_blocking.c index c5681ce..794ced1 100644 --- a/doc/examples/wfstack/cds_wfs_pop_all_blocking.c +++ b/doc/examples/wfstack/cds_wfs_pop_all_blocking.c @@ -27,7 +27,7 @@ struct mynode { struct cds_wfs_node node; /* Chaining in stack */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_wfs_stack mystack; /* Stack */ diff --git a/doc/examples/wfstack/cds_wfs_push.c b/doc/examples/wfstack/cds_wfs_push.c index 2daaef5..42bc5ec 100644 --- a/doc/examples/wfstack/cds_wfs_push.c +++ b/doc/examples/wfstack/cds_wfs_push.c @@ -27,7 +27,7 @@ struct mynode { struct cds_wfs_node node; /* Chaining in stack */ }; -int main(int argc, char **argv) +int main(void) { int values[] = { -5, 42, 36, 24, }; struct cds_wfs_stack mystack; /* Stack */ diff --git a/include/urcu/rculfhash.h b/include/urcu/rculfhash.h index 20b822f..29dd88f 100644 --- a/include/urcu/rculfhash.h +++ b/include/urcu/rculfhash.h @@ -105,7 +105,7 @@ typedef int (*cds_lfht_match_fct)(struct cds_lfht_node *node, const void *key); * (detection of memory corruption). */ static inline -void cds_lfht_node_init(struct cds_lfht_node *node) +void cds_lfht_node_init(struct cds_lfht_node *node __attribute__((unused))) { } diff --git a/include/urcu/static/lfstack.h b/include/urcu/static/lfstack.h index 05d0bb4..b8b544f 100644 --- a/include/urcu/static/lfstack.h +++ b/include/urcu/static/lfstack.h @@ -61,7 +61,7 @@ extern "C" { * cds_lfs_node_init: initialize lock-free stack node. */ static inline -void _cds_lfs_node_init(struct cds_lfs_node *node) +void _cds_lfs_node_init(struct cds_lfs_node *node __attribute__((unused))) { } diff --git a/include/urcu/static/rculfstack.h b/include/urcu/static/rculfstack.h index 3473cce..71d14e0 100644 --- a/include/urcu/static/rculfstack.h +++ b/include/urcu/static/rculfstack.h @@ -34,7 +34,7 @@ extern "C" { #endif static inline -void _cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node) +void _cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node __attribute__((unused))) { } diff --git a/include/urcu/static/wfcqueue.h b/include/urcu/static/wfcqueue.h index eae0743..5e54cbe 100644 --- a/include/urcu/static/wfcqueue.h +++ b/include/urcu/static/wfcqueue.h @@ -112,7 +112,7 @@ static inline void _cds_wfcq_init(struct cds_wfcq_head *head, * cds_wfcq_init(). */ static inline void _cds_wfcq_destroy(struct cds_wfcq_head *head, - struct cds_wfcq_tail *tail) + struct cds_wfcq_tail *tail __attribute__((unused))) { int ret = pthread_mutex_destroy(&head->lock); assert(!ret); @@ -158,7 +158,7 @@ static inline bool _cds_wfcq_empty(cds_wfcq_head_ptr_t u_head, } static inline void _cds_wfcq_dequeue_lock(struct cds_wfcq_head *head, - struct cds_wfcq_tail *tail) + struct cds_wfcq_tail *tail __attribute__((unused))) { int ret; @@ -167,7 +167,7 @@ static inline void _cds_wfcq_dequeue_lock(struct cds_wfcq_head *head, } static inline void _cds_wfcq_dequeue_unlock(struct cds_wfcq_head *head, - struct cds_wfcq_tail *tail) + struct cds_wfcq_tail *tail __attribute__((unused))) { int ret; @@ -331,7 +331,7 @@ ___cds_wfcq_first_nonblocking(cds_wfcq_head_ptr_t head, } static inline struct cds_wfcq_node * -___cds_wfcq_next(cds_wfcq_head_ptr_t head, +___cds_wfcq_next(cds_wfcq_head_ptr_t head __attribute__((unused)), struct cds_wfcq_tail *tail, struct cds_wfcq_node *node, int blocking) diff --git a/src/rculfhash.c b/src/rculfhash.c index 2385f89..aa99c3e 100644 --- a/src/rculfhash.c +++ b/src/rculfhash.c @@ -395,7 +395,8 @@ void cds_lfht_iter_debug_set_ht(struct cds_lfht *ht, struct cds_lfht_iter *iter) #else static -void cds_lfht_iter_debug_set_ht(struct cds_lfht *ht, struct cds_lfht_iter *iter) +void cds_lfht_iter_debug_set_ht(struct cds_lfht *ht __attribute__((unused)), + struct cds_lfht_iter *iter __attribute__((unused))) { } @@ -1570,7 +1571,8 @@ const struct cds_lfht_mm_type *get_mm_type(unsigned long max_nr_buckets) * For 32-bit architectures, use the order allocator. */ static -const struct cds_lfht_mm_type *get_mm_type(unsigned long max_nr_buckets) +const struct cds_lfht_mm_type *get_mm_type( + unsigned long max_nr_buckets __attribute__((unused))) { return &cds_lfht_mm_order; } @@ -1675,7 +1677,8 @@ void cds_lfht_lookup(struct cds_lfht *ht, unsigned long hash, iter->next = next; } -void cds_lfht_next_duplicate(struct cds_lfht *ht, cds_lfht_match_fct match, +void cds_lfht_next_duplicate(struct cds_lfht *ht __attribute__((unused)), + cds_lfht_match_fct match, const void *key, struct cds_lfht_iter *iter) { struct cds_lfht_node *node, *next; @@ -1709,7 +1712,8 @@ void cds_lfht_next_duplicate(struct cds_lfht *ht, cds_lfht_match_fct match, iter->next = next; } -void cds_lfht_next(struct cds_lfht *ht, struct cds_lfht_iter *iter) +void cds_lfht_next(struct cds_lfht *ht __attribute__((unused)), + struct cds_lfht_iter *iter) { struct cds_lfht_node *node, *next; @@ -2115,7 +2119,7 @@ void cds_lfht_resize_lazy_count(struct cds_lfht *ht, unsigned long size, __cds_lfht_resize_lazy_launch(ht); } -static void cds_lfht_before_fork(void *priv) +static void cds_lfht_before_fork(void *priv __attribute__((unused))) { if (cds_lfht_workqueue_atfork_nesting++) return; @@ -2125,7 +2129,7 @@ static void cds_lfht_before_fork(void *priv) urcu_workqueue_pause_worker(cds_lfht_workqueue); } -static void cds_lfht_after_fork_parent(void *priv) +static void cds_lfht_after_fork_parent(void *priv __attribute__((unused))) { if (--cds_lfht_workqueue_atfork_nesting) return; @@ -2136,7 +2140,7 @@ end: mutex_unlock(&cds_lfht_fork_mutex); } -static void cds_lfht_after_fork_child(void *priv) +static void cds_lfht_after_fork_child(void *priv __attribute__((unused))) { if (--cds_lfht_workqueue_atfork_nesting) return; @@ -2158,8 +2162,9 @@ static struct urcu_atfork cds_lfht_atfork = { * disturb the application. The SIGRCU signal needs to be unblocked for * the urcu-signal flavor. */ -static void cds_lfht_worker_init(struct urcu_workqueue *workqueue, - void *priv) +static void cds_lfht_worker_init( + struct urcu_workqueue *workqueue __attribute__((unused)), + void *priv __attribute__((unused))) { int ret; sigset_t mask; diff --git a/src/urcu-call-rcu-impl.h b/src/urcu-call-rcu-impl.h index 18fd65a..530abfe 100644 --- a/src/urcu-call-rcu-impl.h +++ b/src/urcu-call-rcu-impl.h @@ -1053,7 +1053,7 @@ end: URCU_ATTR_ALIAS(urcu_stringify(urcu_register_rculfhash_atfork)) void alias_urcu_register_rculfhash_atfork(); -void urcu_unregister_rculfhash_atfork(struct urcu_atfork *atfork) +void urcu_unregister_rculfhash_atfork(struct urcu_atfork *atfork __attribute__((unused))) { call_rcu_lock(&call_rcu_mutex); if (--registered_rculfhash_atfork_refcount) diff --git a/src/urcu-defer-impl.h b/src/urcu-defer-impl.h index b34a1a1..969231f 100644 --- a/src/urcu-defer-impl.h +++ b/src/urcu-defer-impl.h @@ -376,7 +376,7 @@ static void _defer_rcu(void (*fct)(void *p), void *p) wake_up_defer(); } -static void *thr_defer(void *args) +static void *thr_defer(void *args __attribute__((unused))) { for (;;) { /* diff --git a/src/urcu.c b/src/urcu.c index 2ebe993..e64432f 100644 --- a/src/urcu.c +++ b/src/urcu.c @@ -622,7 +622,9 @@ void alias_rcu_init(void); #endif #ifdef RCU_SIGNAL -static void sigrcu_handler(int signo, siginfo_t *siginfo, void *context) +static void sigrcu_handler(int signo __attribute__((unused)), + siginfo_t *siginfo __attribute__((unused)), + void *context __attribute__((unused))) { /* * Executing this cmm_smp_mb() is the only purpose of this signal handler. diff --git a/tests/benchmark/test_looplen.c b/tests/benchmark/test_looplen.c index 76430a3..51c1744 100644 --- a/tests/benchmark/test_looplen.c +++ b/tests/benchmark/test_looplen.c @@ -50,7 +50,7 @@ static inline void loop_sleep(unsigned long loops) #define LOOPS 1048576 #define TESTS 10 -int main(int argc, char **argv) +int main(void) { unsigned long i; caa_cycles_t time1, time2; diff --git a/tests/benchmark/test_mutex.c b/tests/benchmark/test_mutex.c index d855b49..8df7677 100644 --- a/tests/benchmark/test_mutex.c +++ b/tests/benchmark/test_mutex.c @@ -213,7 +213,7 @@ void *thr_writer(void *data) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -237,26 +237,26 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } cmm_smp_mb(); err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -266,7 +266,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -276,21 +276,21 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_perthreadlock.c b/tests/benchmark/test_perthreadlock.c index a4b1745..bf2490a 100644 --- a/tests/benchmark/test_perthreadlock.c +++ b/tests/benchmark/test_perthreadlock.c @@ -246,7 +246,7 @@ void *thr_writer(void *data) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -269,26 +269,26 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } cmm_smp_mb(); err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -298,7 +298,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -308,21 +308,21 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_rwlock.c b/tests/benchmark/test_rwlock.c index 284ddf1..38b2a71 100644 --- a/tests/benchmark/test_rwlock.c +++ b/tests/benchmark/test_rwlock.c @@ -238,7 +238,7 @@ void *thr_writer(void *_count) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -262,26 +262,26 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } cmm_smp_mb(); err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -291,7 +291,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -301,21 +301,21 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu.c b/tests/benchmark/test_urcu.c index ff718fe..8472087 100644 --- a/tests/benchmark/test_urcu.c +++ b/tests/benchmark/test_urcu.c @@ -221,7 +221,7 @@ void *thr_writer(void *_count) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -246,25 +246,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -280,7 +280,7 @@ int main(int argc, char **argv) break; case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -290,21 +290,21 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_assign.c b/tests/benchmark/test_urcu_assign.c index 758165e..9a0f266 100644 --- a/tests/benchmark/test_urcu_assign.c +++ b/tests/benchmark/test_urcu_assign.c @@ -277,7 +277,7 @@ void *thr_writer(void *_count) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -302,25 +302,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -336,7 +336,7 @@ int main(int argc, char **argv) break; case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -346,21 +346,21 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_bp.c b/tests/benchmark/test_urcu_bp.c index 0da2717..f816a5c 100644 --- a/tests/benchmark/test_urcu_bp.c +++ b/tests/benchmark/test_urcu_bp.c @@ -216,7 +216,7 @@ void *thr_writer(void *_count) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -241,25 +241,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -275,7 +275,7 @@ int main(int argc, char **argv) break; case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -285,21 +285,21 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_defer.c b/tests/benchmark/test_urcu_defer.c index 18a321d..78d2602 100644 --- a/tests/benchmark/test_urcu_defer.c +++ b/tests/benchmark/test_urcu_defer.c @@ -182,11 +182,11 @@ void *thr_reader(void *_count) } -static void test_cb2(void *data) +static void test_cb2(void *data __attribute__((unused))) { } -static void test_cb1(void *data) +static void test_cb1(void *data __attribute__((unused))) { } @@ -243,7 +243,7 @@ void *thr_writer(void *data) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -268,25 +268,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -302,7 +302,7 @@ int main(int argc, char **argv) break; case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -312,21 +312,21 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_gc.c b/tests/benchmark/test_urcu_gc.c index 15482cb..65ec6ba 100644 --- a/tests/benchmark/test_urcu_gc.c +++ b/tests/benchmark/test_urcu_gc.c @@ -264,7 +264,7 @@ void *thr_writer(void *data) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -289,25 +289,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -323,7 +323,7 @@ int main(int argc, char **argv) break; case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -333,28 +333,28 @@ int main(int argc, char **argv) break; case 'b': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } reclaim_batch = atol(argv[++i]); break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_hash.c b/tests/benchmark/test_urcu_hash.c index 8c97bd9..297e0c0 100644 --- a/tests/benchmark/test_urcu_hash.c +++ b/tests/benchmark/test_urcu_hash.c @@ -204,7 +204,7 @@ unsigned long test_compare(const void *key1, size_t key1_len, } static -void *thr_count(void *arg) +void *thr_count(void *arg __attribute__((unused))) { printf_verbose("thread_begin %s, tid %lu\n", "counter", urcu_get_thread_id()); @@ -270,7 +270,7 @@ void test_delete_all_nodes(struct cds_lfht *ht) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -323,28 +323,28 @@ int main(int argc, char **argv) long long nr_leaked; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } @@ -361,7 +361,7 @@ int main(int argc, char **argv) break; case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } @@ -372,7 +372,7 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } @@ -380,7 +380,7 @@ int main(int argc, char **argv) break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } @@ -391,7 +391,7 @@ int main(int argc, char **argv) break; case 'h': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } @@ -399,7 +399,7 @@ int main(int argc, char **argv) break; case 'm': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } @@ -407,7 +407,7 @@ int main(int argc, char **argv) break; case 'n': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } @@ -438,7 +438,7 @@ int main(int argc, char **argv) break; case 'B': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); mainret = 1; goto end; } diff --git a/tests/benchmark/test_urcu_hash_rw.c b/tests/benchmark/test_urcu_hash_rw.c index f72e20b..862a6f0 100644 --- a/tests/benchmark/test_urcu_hash_rw.c +++ b/tests/benchmark/test_urcu_hash_rw.c @@ -30,7 +30,7 @@ enum urcu_hash_addremove { static enum urcu_hash_addremove addremove; /* 1: add, -1 remove, 0: random */ -void test_hash_rw_sigusr1_handler(int signo) +void test_hash_rw_sigusr1_handler(int signo __attribute__((unused))) { switch (addremove) { case AR_ADD: @@ -48,7 +48,7 @@ void test_hash_rw_sigusr1_handler(int signo) } } -void test_hash_rw_sigusr2_handler(int signo) +void test_hash_rw_sigusr2_handler(int signo __attribute__((unused))) { char msg[1] = { 0x42 }; ssize_t ret; diff --git a/tests/benchmark/test_urcu_hash_unique.c b/tests/benchmark/test_urcu_hash_unique.c index f03adfd..de7c427 100644 --- a/tests/benchmark/test_urcu_hash_unique.c +++ b/tests/benchmark/test_urcu_hash_unique.c @@ -30,7 +30,7 @@ enum urcu_hash_addremove { static enum urcu_hash_addremove addremove; /* 1: add, -1 remove, 0: random */ -void test_hash_unique_sigusr1_handler(int signo) +void test_hash_unique_sigusr1_handler(int signo __attribute__((unused))) { switch (addremove) { case AR_ADD: @@ -48,7 +48,7 @@ void test_hash_unique_sigusr1_handler(int signo) } } -void test_hash_unique_sigusr2_handler(int signo) +void test_hash_unique_sigusr2_handler(int signo __attribute__((unused))) { char msg[1] = { 0x42 }; ssize_t ret; diff --git a/tests/benchmark/test_urcu_lfq.c b/tests/benchmark/test_urcu_lfq.c index 7830529..ff3585a 100644 --- a/tests/benchmark/test_urcu_lfq.c +++ b/tests/benchmark/test_urcu_lfq.c @@ -263,7 +263,7 @@ void test_end(unsigned long long *nr_dequeues_l) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) \n", argv[0]); @@ -289,25 +289,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_dequeuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_enqueuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -317,7 +317,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -327,14 +327,14 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_lfs.c b/tests/benchmark/test_urcu_lfs.c index 49a8953..94aa965 100644 --- a/tests/benchmark/test_urcu_lfs.c +++ b/tests/benchmark/test_urcu_lfs.c @@ -322,7 +322,7 @@ static void test_end(unsigned long long *nr_dequeues_l) } while (snode); } -static void show_usage(int argc, char **argv) +static void show_usage(char **argv) { printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) \n", argv[0]); @@ -352,25 +352,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_dequeuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_enqueuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -380,7 +380,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -390,14 +390,14 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_lfs_rcu.c b/tests/benchmark/test_urcu_lfs_rcu.c index d929ea3..b8cb335 100644 --- a/tests/benchmark/test_urcu_lfs_rcu.c +++ b/tests/benchmark/test_urcu_lfs_rcu.c @@ -265,7 +265,7 @@ void test_end(unsigned long long *nr_dequeues_l) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) \n", argv[0]); @@ -291,25 +291,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_dequeuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_enqueuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -319,7 +319,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -329,14 +329,14 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_qsbr.c b/tests/benchmark/test_urcu_qsbr.c index 52cec27..c5b2e43 100644 --- a/tests/benchmark/test_urcu_qsbr.c +++ b/tests/benchmark/test_urcu_qsbr.c @@ -227,7 +227,7 @@ void *thr_writer(void *_count) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -252,25 +252,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -286,7 +286,7 @@ int main(int argc, char **argv) break; case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -296,21 +296,21 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_qsbr_gc.c b/tests/benchmark/test_urcu_qsbr_gc.c index 5910323..e49e9ca 100644 --- a/tests/benchmark/test_urcu_qsbr_gc.c +++ b/tests/benchmark/test_urcu_qsbr_gc.c @@ -264,7 +264,7 @@ void *thr_writer(void *data) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_readers nr_writers duration (s) \n", argv[0]); @@ -290,25 +290,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_readers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_writers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -324,7 +324,7 @@ int main(int argc, char **argv) break; case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -334,28 +334,28 @@ int main(int argc, char **argv) break; case 'b': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } reclaim_batch = atol(argv[++i]); break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); break; case 'e': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wduration = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_wfcq.c b/tests/benchmark/test_urcu_wfcq.c index 96045c7..7497155 100644 --- a/tests/benchmark/test_urcu_wfcq.c +++ b/tests/benchmark/test_urcu_wfcq.c @@ -326,7 +326,7 @@ static void test_end(unsigned long long *nr_dequeues_l, } while (node); } -static void show_usage(int argc, char **argv) +static void show_usage(char **argv) { printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) \n", argv[0]); @@ -360,25 +360,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_dequeuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_enqueuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -388,7 +388,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -398,14 +398,14 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_wfq.c b/tests/benchmark/test_urcu_wfq.c index bd733fe..09f7a0d 100644 --- a/tests/benchmark/test_urcu_wfq.c +++ b/tests/benchmark/test_urcu_wfq.c @@ -235,7 +235,7 @@ void test_end(unsigned long long *nr_dequeues_l) } static -void show_usage(int argc, char **argv) +void show_usage(char **argv) { printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) \n", argv[0]); @@ -261,25 +261,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_dequeuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_enqueuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -289,7 +289,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -299,14 +299,14 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); diff --git a/tests/benchmark/test_urcu_wfs.c b/tests/benchmark/test_urcu_wfs.c index beade9a..5d90ad6 100644 --- a/tests/benchmark/test_urcu_wfs.c +++ b/tests/benchmark/test_urcu_wfs.c @@ -313,7 +313,7 @@ static void test_end(unsigned long long *nr_dequeues_l, } while (node); } -static void show_usage(int argc, char **argv) +static void show_usage(char **argv) { printf("Usage : %s nr_dequeuers nr_enqueuers duration (s) \n", argv[0]); @@ -347,25 +347,25 @@ int main(int argc, char **argv) unsigned int i_thr; if (argc < 4) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[1], "%u", &nr_dequeuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[2], "%u", &nr_enqueuers); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } err = sscanf(argv[3], "%lu", &duration); if (err != 1) { - show_usage(argc, argv); + show_usage(argv); return -1; } @@ -375,7 +375,7 @@ int main(int argc, char **argv) switch (argv[i][1]) { case 'a': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } a = atoi(argv[++i]); @@ -385,14 +385,14 @@ int main(int argc, char **argv) break; case 'c': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } rduration = atol(argv[++i]); break; case 'd': if (argc < i + 2) { - show_usage(argc, argv); + show_usage(argv); return -1; } wdelay = atol(argv[++i]); diff --git a/tests/common/debug-yield.h b/tests/common/debug-yield.h index b48561c..7f1b58a 100644 --- a/tests/common/debug-yield.h +++ b/tests/common/debug-yield.h @@ -87,11 +87,13 @@ static inline void rcu_debug_yield_write(void) { } -static inline void rcu_debug_yield_enable(unsigned int flags) +static inline void rcu_debug_yield_enable( + unsigned int flags __attribute__((unused))) { } -static inline void rcu_debug_yield_disable(unsigned int flags) +static inline void rcu_debug_yield_disable( + unsigned int flags __attribute__((unused))) { } diff --git a/tests/regression/rcutorture.h b/tests/regression/rcutorture.h index 46a6737..0c5c895 100644 --- a/tests/regression/rcutorture.h +++ b/tests/regression/rcutorture.h @@ -160,7 +160,7 @@ void *rcu_read_perf_test(void *arg) } static -void *rcu_update_perf_test(void *arg) +void *rcu_update_perf_test(void *arg __attribute__((unused))) { long long n_updates_local = 0; @@ -300,7 +300,7 @@ DEFINE_PER_THREAD(long long [RCU_STRESS_PIPE_LEN + 1], rcu_stress_count); int garbage = 0; static -void *rcu_read_stress_test(void *arg) +void *rcu_read_stress_test(void *arg __attribute__((unused))) { int i; int itercnt = 0; @@ -344,7 +344,7 @@ static pthread_mutex_t call_rcu_test_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t call_rcu_test_cond = PTHREAD_COND_INITIALIZER; static -void rcu_update_stress_test_rcu(struct rcu_head *head) +void rcu_update_stress_test_rcu(struct rcu_head *head __attribute__((unused))) { int ret; @@ -372,7 +372,7 @@ void rcu_update_stress_test_rcu(struct rcu_head *head) } static -void *rcu_update_stress_test(void *arg) +void *rcu_update_stress_test(void *arg __attribute__((unused))) { int i; struct rcu_stress *p; @@ -446,7 +446,7 @@ void *rcu_update_stress_test(void *arg) } static -void *rcu_fake_update_stress_test(void *arg) +void *rcu_fake_update_stress_test(void *arg __attribute__((unused))) { if (callrcu_type == CALLRCU_PERTHREAD) { struct call_rcu_data *crdp; @@ -532,7 +532,7 @@ int stresstest(int nreaders) */ static -void usage(int argc, char *argv[]) +void usage(char *argv[]) { diag("Usage: %s nreaders [ perf | rperf | uperf | stress ] [ stride ] [ callrcu_global | callrcu_percpu | callrcu_perthread ]\n", argv[0]); exit(-1); @@ -557,7 +557,7 @@ int main(int argc, char *argv[]) } else if (strcmp(callrcu_str, "callrcu_perthread") == 0) { callrcu_type = CALLRCU_PERTHREAD; } else { - usage(argc, argv); + usage(argv); goto end; } } @@ -587,7 +587,7 @@ int main(int argc, char *argv[]) if (argc > 1) { if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) { - usage(argc, argv); + usage(argv); goto end; } nreaders = strtoul(argv[1], NULL, 0); @@ -616,9 +616,9 @@ int main(int argc, char *argv[]) "stresstest readers: %d, stride: %d", nreaders, cpustride); else - usage(argc, argv); + usage(argv); } else { - usage(argc, argv); + usage(argv); } end: return exit_status(); diff --git a/tests/regression/test_urcu_fork.c b/tests/regression/test_urcu_fork.c index 8118be7..b6f94f5 100644 --- a/tests/regression/test_urcu_fork.c +++ b/tests/regression/test_urcu_fork.c @@ -163,7 +163,7 @@ static int do_fork(const char *execname) } } -int main(int argc, char **argv) +int main(int argc __attribute__((unused)), char **argv) { unsigned int i; diff --git a/tests/unit/test_uatomic.c b/tests/unit/test_uatomic.c index fe2a6c1..5884455 100644 --- a/tests/unit/test_uatomic.c +++ b/tests/unit/test_uatomic.c @@ -91,7 +91,7 @@ do { \ \ } while (0) -int main(int argc, char **argv) +int main(void) { int nr_run = 2; #ifdef UATOMIC_HAS_ATOMIC_BYTE diff --git a/tests/unit/test_urcu_multiflavor.c b/tests/unit/test_urcu_multiflavor.c index 192884e..225161a 100644 --- a/tests/unit/test_urcu_multiflavor.c +++ b/tests/unit/test_urcu_multiflavor.c @@ -25,7 +25,7 @@ #include "tap.h" -int main(int argc, char **argv) +int main(void) { plan_tests(5); diff --git a/tests/unit/test_urcu_multiflavor_single_unit.c b/tests/unit/test_urcu_multiflavor_single_unit.c index 909d4d2..aff292a 100644 --- a/tests/unit/test_urcu_multiflavor_single_unit.c +++ b/tests/unit/test_urcu_multiflavor_single_unit.c @@ -83,7 +83,7 @@ static int test_mf_qsbr(void) return 0; } -int main(int argc, char **argv) +int main(void) { plan_tests(5);