https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104929
--- Comment #3 from Jakub Jelinek ---
In this particular case the problem is that UBSAN adds the non-NULL tests, so
the IL becomes if (!s) __ubsan_handle_nonnull_arg (...); sprintf(s, " "); if
(!s) __ubsan_handle_nonnull_arg (...); return __bui
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104929
--- Comment #2 from Andreas Schwab ---
I think the point here is that s is not guaranteed to be non-NULL. You can add
if (s == 0) __builtin_unreachable();
to suppress the warning.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104929
--- Comment #1 from Martin Liška ---
It's a quite known limitation that usage of sanitizers tends to emit false
positives of various warnings.