Casting between incompatible function pointers is UB

This commit is contained in:
Martins Mozeiko authored and Nikita committed 2026-09-03 14:09:15 -07:00
1 parent 99d00a5a42
commit dd125cc04e
1 file changed
+4 -2
+4 -2
View File
@@ -949,8 +949,10 @@ t_match_linef(String8 *output, char *fmt, ...)
} }
force_inline int force_inline int
t_test_info_is_before(TestInfo **a, TestInfo **b) t_test_info_is_before(void *a_, void *b_)
{ {
TestInfo **a = a_;
TestInfo **b = b_;
String8 layer_a = a[0]->layer; String8 layer_a = a[0]->layer;
String8 layer_b = b[0]->layer; String8 layer_b = b[0]->layer;
int cmp = str8_compar(layer_a, layer_b, 0); int cmp = str8_compar(layer_a, layer_b, 0);
@@ -1135,7 +1137,7 @@ t_entry_point(CmdLine *cmdline)
// Gather tests // Gather tests
{ {
for EachIndex(i, test_infos_count) { g_sorted_test_infos[i] = &test_infos[i]; } for EachIndex(i, test_infos_count) { g_sorted_test_infos[i] = &test_infos[i]; }
radsort(g_sorted_test_infos, test_infos_count, (int (*)(void *, void *))t_test_info_is_before); radsort(g_sorted_test_infos, test_infos_count, t_test_info_is_before);
} }
// //