Fix nonnull warning for std::string
std::string should only be assigned non-null values (string, c-string,
char) so it cannot be assigned null values (0 or nullptr) which caused
the warning. We can fix this by returning an empty string.
art/libartbase/base/utils.cc:533:12: error: null passed to a callee that
requires a non-null argument [-Werror,-Wnonnull]
533 | return nullptr;
| ^~~~~~~
art/libartbase/base/utils.cc:548:12: error: null passed to a callee that
requires a non-null argument [-Werror,-Wnonnull]
548 | return nullptr;
| ^~~~~~~
art/libartbase/base/utils.cc:555:14: error: null passed to a callee that
requires a non-null argument [-Werror,-Wnonnull]
555 | return nullptr;
| ^~~~~~~
art/libartbase/base/utils.cc:561:12: error: null passed to a callee that
requires a non-null argument [-Werror,-Wnonnull]
561 | return nullptr;
| ^~~~~~~
4 errors generated.
Bug: 430598176
Test: m && presubmit
Flag: EXEMPT BUGFIX
Change-Id: Id700d69b306df9f708ffe74d003cf96d4ae90d8b
1 file changed