commit cdaa991d59b6083bab30f1bd86345f57717a5670 from: Stefan Sperling date: Fri Oct 16 22:59:47 2020 UTC fix a format string issue in array test ARRAYLIST_IDX deals with the head pointer. Explicitly cast to unsigned long and use %lu in the format string. Clang 10.0.1 used to complain as follows: arraylist_test.c:19:2: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] arraylist_test.c:15:24: note: expanded from macro 'dump' printf("[%d] %d\n", ARRAYLIST_IDX(p, list), *p); \ ~~ ^~~~~~~~~~~~~~~~~~~~~~ commit - db941c245fd5f7b8e8ca2f9b6ebaf0c3dcecda48 commit + cdaa991d59b6083bab30f1bd86345f57717a5670 blob - eb1fec8d558f037374b10b3f5abbb28a96728670 blob + da5542e8d629664135ca889450c3646ff8bc3063 --- test/arraylist_test.c +++ test/arraylist_test.c @@ -12,7 +12,8 @@ void test_basic(void) #define dump() do {\ printf("(%d items)\n", list.len); \ ARRAYLIST_FOREACH(p, list) \ - printf("[%d] %d\n", ARRAYLIST_IDX(p, list), *p); \ + printf("[%lu] %d\n", \ + (unsigned long)ARRAYLIST_IDX(p, list), *p); \ printf("\n"); \ } while(0)