Code quality: Fix some cppcheck messages

This commit addresses these kind of errors:

portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB]

Reason is that C does not guarantee that all pointer types are the same
size. See C99 6.2.5(27). cppcheck requires some sort of cast when NULL
is used as the last argument in a variadic list.
This commit is contained in:
matt335672
2026-02-20 12:06:05 +00:00
committed by firewave
parent 94c0024c3b
commit d3bfe802cc
10 changed files with 41 additions and 31 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ START_TEST(test_list__simple_strdup_multi)
list_add_strdup_multi(lst,
"0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "10", "11",
NULL);
LIST_ADD_STRDUP_TERM);
ck_assert_int_eq(lst->count, 12);