From ab491472f44eef098974dd7f6633ec5dc352bb77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 5 Nov 2023 19:09:39 +0100 Subject: [PATCH] options/m_option: suppress warning about validate function call It is expected. Last argument of validate functions is always a pointer, but not always void* which triggers UBSAN warning. meson since 1.3.1 halts on UBSAN errors in tests, which is good thing. --- options/m_option.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/options/m_option.c b/options/m_option.c index f5fe533f54..18346d0374 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -61,6 +61,11 @@ const char m_option_path_separator = OPTION_PATH_SEPARATOR; #define OPT_INT_MAX(opt, T, Tm) ((opt)->min < (opt)->max \ ? ((opt)->max >= (double)(Tm) ? (Tm) : (T)((opt)->max)) : (Tm)) +#if defined(__clang__) +// Last argument of validate functions is always a pointer, but not always void* +// which triggers UBSAN warning. +__attribute__((no_sanitize("function"))) +#endif int m_option_parse(struct mp_log *log, const m_option_t *opt, struct bstr name, struct bstr param, void *dst) {