diff --git a/test/linked_list.c b/test/linked_list.c index 6ad61f36ec..a7b5b6b171 100644 --- a/test/linked_list.c +++ b/test/linked_list.c @@ -14,6 +14,12 @@ struct the_list { struct list_item *head, *tail; }; +// This serves to remove some -Waddress "always true" warnings. +static struct list_item *STUPID_SHIT(struct list_item *item) +{ + return item; +} + static bool do_check_list(struct the_list *lst, int *c, int num_c) { if (!lst->head) @@ -100,13 +106,13 @@ static void test_linked_list(void **state) LL_INSERT_BEFORE(list_node, &lst, (struct list_item *)NULL, &e2); check_list(6, 1, 2); - LL_INSERT_BEFORE(list_node, &lst, &e6, &e3); + LL_INSERT_BEFORE(list_node, &lst, STUPID_SHIT(&e6), &e3); check_list(3, 6, 1, 2); - LL_INSERT_BEFORE(list_node, &lst, &e6, &e5); + LL_INSERT_BEFORE(list_node, &lst, STUPID_SHIT(&e6), &e5); check_list(3, 5, 6, 1, 2); - LL_INSERT_BEFORE(list_node, &lst, &e2, &e4); + LL_INSERT_BEFORE(list_node, &lst, STUPID_SHIT(&e2), &e4); check_list(3, 5, 6, 1, 4, 2); LL_REMOVE(list_node, &lst, &e6); @@ -142,13 +148,13 @@ static void test_linked_list(void **state) LL_INSERT_AFTER(list_node, &lst, (struct list_item *)NULL, &e3); check_list(3, 2, 1); - LL_INSERT_AFTER(list_node, &lst, &e3, &e4); + LL_INSERT_AFTER(list_node, &lst, STUPID_SHIT(&e3), &e4); check_list(3, 4, 2, 1); - LL_INSERT_AFTER(list_node, &lst, &e4, &e5); + LL_INSERT_AFTER(list_node, &lst, STUPID_SHIT(&e4), &e5); check_list(3, 4, 5, 2, 1); - LL_INSERT_AFTER(list_node, &lst, &e1, &e6); + LL_INSERT_AFTER(list_node, &lst, STUPID_SHIT(&e1), &e6); check_list(3, 4, 5, 2, 1, 6); }