git: b13e59714ffe - stable/13 - kldxref: fix bootstrapping on Linux with Clang 16

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 18 Jan 2024 22:26:33 UTC
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=b13e59714ffe5b756ffac134a5f802ec7aa3c5ad

commit b13e59714ffe5b756ffac134a5f802ec7aa3c5ad
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2024-01-02 19:06:51 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-01-18 21:31:52 +0000

    kldxref: fix bootstrapping on Linux with Clang 16
    
    The glibc fts_open() callback type does not have the second const
    qualifier and it appears that Clang 16 errors by default for mismatched
    function pointer types. Add an ifdef to handle this case.
    
    (cherry picked from commit 30887c7d48ead8a9151627228244dd3ed95c4c6d)
---
 usr.sbin/kldxref/kldxref.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c
index 4a63c2b8e562..c4e65b7e679b 100644
--- a/usr.sbin/kldxref/kldxref.c
+++ b/usr.sbin/kldxref/kldxref.c
@@ -748,7 +748,11 @@ usage(void)
 }
 
 static int
+#ifdef __GLIBC__
+compare(const FTSENT **a, const FTSENT **b)
+#else
 compare(const FTSENT *const *a, const FTSENT *const *b)
+#endif
 {
 
 	if ((*a)->fts_info == FTS_D && (*b)->fts_info != FTS_D)