Skip to content

Commit 3621202

Browse files
charmitrotridge
authored andcommitted
hlink: Fix function pointer cast in qsort()
Replace unsafe generic function pointer cast with proper type cast for qsort() comparison function. This fixes a potential type mismatch warning without changing the behavior. Signed-off-by: Charalampos Mitrodimas <charmitro@posteo.net>
1 parent 2b38542 commit 3621202

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static void match_gnums(int32 *ndx_list, int ndx_count)
117117
struct ht_int32_node *node = NULL;
118118
int32 gnum, gnum_next;
119119

120-
qsort(ndx_list, ndx_count, sizeof ndx_list[0], (int (*)()) hlink_compare_gnum);
120+
qsort(ndx_list, ndx_count, sizeof ndx_list[0], (int (*)(const void*, const void*))hlink_compare_gnum);
121121

122122
for (from = 0; from < ndx_count; from++) {
123123
file = hlink_flist->sorted[ndx_list[from]];

0 commit comments

Comments
 (0)