Apple clang version 14.0.0 (clang-1400.0.29.202) v3 tree: 58d046645ad TIDBitmap uses sort_template.h for pagetable sorting == st_ptr_runtime.c, comparator: cmp_item(Item *const *a, Item *const *b) v3 sort_template.h, warnings+errors: 19 1 warning: incompatible function pointer types passing 'int (Item *const *, Item *const *)' (aka 'int (struct Item *const *, struct Item *const *)') to parameter of type 'sort_item_ptrs_compare_function' (aka 'int (*)(const struct Item **, const struct Item **)') [-Wincompatible-function-pointer-types] 18 warning: passing 'Item **' (aka 'struct Item **') to parameter of type 'const Item **' (aka 'const struct Item **') discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] v3 + typedef fix, warnings+errors: 0 v3 + typedef fix, object file built: yes == st_ptr_runtime_match.c, comparator: cmp_item(const Item **a, const Item **b) v3 sort_template.h, warnings+errors: 18 18 warning: passing 'Item **' (aka 'struct Item **') to parameter of type 'const Item **' (aka 'const struct Item **') discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] v3 + typedef fix, warnings+errors: 1 v3 + typedef fix, object file built: st_ptr_runtime_match.c:24:23: warning: incompatible function pointer types passing 'int (const Item **, const Item **)' (aka 'int (const struct Item **, const struct Item **)') to parameter of type 'sort_item_ptrs_compare_function' (aka 'int (*)(struct Item *const *, struct Item *const *)') [-Wincompatible-function-pointer-types] sort_item_ptrs(v, n, cmp_item); ^~~~~~~~ /Users/zhongshihao/pg-work/replies-2026-10-16/items/tidbitmap-v3/repro/fixinc/lib/sort_template.h:296:3: note: passing argument to parameter 'compare' here ST_SORT_PROTO_COMPARE ^ /Users/zhongshihao/pg-work/replies-2026-10-16/items/tidbitmap-v3/repro/fixinc/lib/sort_template.h:161:57: note: expanded from macro 'ST_SORT_PROTO_COMPARE' #define ST_SORT_PROTO_COMPARE , ST_COMPARATOR_TYPE_NAME compare ^ 1 warning generated. yes == fix --- /Users/zhongshihao/Desktop/OpenSource/postgres_ai/postgres/.claude/worktrees/wf_da2139a6-f02-6/src/include/lib/sort_template.h 2026-10-16 22:28:31 +++ /Users/zhongshihao/pg-work/replies-2026-10-16/items/tidbitmap-v3/repro/fixinc/lib/sort_template.h 2026-10-16 22:33:44 @@ -59,7 +59,7 @@ * * ST_SORT_compare_function is a function pointer of the following type: * - * int (*)(const ST_ELEMENT_TYPE *a, const ST_ELEMENT_TYPE *b, + * int (*)(ST_ELEMENT_TYPE const *a, ST_ELEMENT_TYPE const *b, * [ST_COMPARE_ARG_TYPE *arg]) * * HISTORY @@ -185,8 +185,8 @@ #ifdef ST_DECLARE #ifdef ST_COMPARE_RUNTIME_POINTER -typedef int (*ST_COMPARATOR_TYPE_NAME) (const ST_ELEMENT_TYPE *, - const ST_ELEMENT_TYPE * ST_SORT_PROTO_ARG); +typedef int (*ST_COMPARATOR_TYPE_NAME) (ST_ELEMENT_TYPE const *, + ST_ELEMENT_TYPE const * ST_SORT_PROTO_ARG); #endif /* Declare the sort function. Note optional arguments at end. */