Skip to content

Commit 00dc514

Browse files
committed
perf python: Disable -Wno-cast-function-type-mismatch if present on clang
The -Wcast-function-type-mismatch option was introduced in clang 19 and its enabled by default, since we use -Werror, and python bindings do casts that are valid but trips this warning, disable it if present. Closes: https://lore.kernel.org/all/CA+icZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@mail.gmail.com Reported-by: Sedat Dilek <[email protected]> Tested-by: Sedat Dilek <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: [email protected] # To allow building with the upcoming clang 19 Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent b811623 commit 00dc514

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/perf/util/setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def finalize_options(self):
6363
cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls' ]
6464
if cc_is_clang:
6565
cflags += ["-Wno-unused-command-line-argument" ]
66+
if clang_has_option("-Wno-cast-function-type-mismatch"):
67+
cflags += ["-Wno-cast-function-type-mismatch" ]
6668
else:
6769
cflags += ['-Wno-cast-function-type' ]
6870

0 commit comments

Comments
 (0)