<fts.h>: fix fts_compar declaration for C23.
In C23, `void foo()` means `void foo(void)`, not `void foo(...)`.
Bug: http://b/395885866
(cherry picked from https://android-review.googlesource.com/q/commit:903b30650eac60523b4b6f7d16cfd851a402c423)
Merged-In: I10da57db60d1921f930e78db3a792aceeae04e5e
Change-Id: I10da57db60d1921f930e78db3a792aceeae04e5e
diff --git a/libc/bionic/fts.c b/libc/bionic/fts.c
index c36835e..072d297 100644
--- a/libc/bionic/fts.c
+++ b/libc/bionic/fts.c
@@ -892,7 +892,9 @@
}
for (ap = sp->fts_array, p = head; p; p = p->fts_link)
*ap++ = p;
- qsort(sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
+ // The cast here is to cast away the nullability.
+ // fts_compar is nullable, but we only enter this function if it's non-null.
+ qsort(sp->fts_array, nitems, sizeof(FTSENT *), (int (*)(const void*, const void*)) sp->fts_compar);
for (head = *(ap = sp->fts_array); --nitems; ++ap)
ap[0]->fts_link = ap[1];
ap[0]->fts_link = NULL;