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.
This commit is contained in:
Kacper Michajłow 2023-11-05 19:09:39 +01:00 committed by Dudemanguy
parent 68f1057d2e
commit ab491472f4
1 changed files with 5 additions and 0 deletions

View File

@ -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)
{