git: 30887c7d48ea - main - kldxref: fix bootstrapping on Linux with Clang 16
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 02 Jan 2024 19:11:31 UTC
The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=30887c7d48ead8a9151627228244dd3ed95c4c6d commit 30887c7d48ead8a9151627228244dd3ed95c4c6d Author: Alex Richardson <arichardson@FreeBSD.org> AuthorDate: 2024-01-02 19:06:51 +0000 Commit: Alex Richardson <arichardson@FreeBSD.org> CommitDate: 2024-01-02 19:06:51 +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. --- 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 68f010a6db98..1694f069564b 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)