Skip to content

Commit

Permalink
jevents: fix bootstrapping on Linux with Clang 16
Browse files Browse the repository at this point in the history
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.

Reviewed By:	imp, emaste
Differential Revision: https://reviews.freebsd.org/D43000
  • Loading branch information
arichardson committed Dec 12, 2023
1 parent 0156465 commit 60e845c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/libpmc/pmu-events/jevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,11 @@ int main(int argc, char *argv[])
#include <fts.h>

static int
#ifdef __GLIBC__
fts_compare(const FTSENT **a, const FTSENT **b)
#else
fts_compare(const FTSENT * const *a, const FTSENT * const *b)
#endif
{
return (strcmp((*a)->fts_name, (*b)->fts_name));
}
Expand Down

0 comments on commit 60e845c

Please sign in to comment.