From 30887c7d48ead8a9151627228244dd3ed95c4c6d Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Tue, 2 Jan 2024 11:06:51 -0800 Subject: [PATCH] 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. --- 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 68f010a6db9..1694f069564 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)