-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[asan] Avoid -Wtautological-pointer-compare #164918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
llvm#164906 converted bool-pointer compare into -Wtautological-pointer-compare.
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Thurston Dang (thurstond) Changes#164906 converted bool-pointer compare into -Wtautological-pointer-compare. Fix both by using the bool cast. Full diff: https://github.com/llvm/llvm-project/pull/164918.diff 1 Files Affected:
diff --git a/compiler-rt/lib/asan/asan_interceptors.cpp b/compiler-rt/lib/asan/asan_interceptors.cpp
index c43332cbc276d..8643271e89d70 100644
--- a/compiler-rt/lib/asan/asan_interceptors.cpp
+++ b/compiler-rt/lib/asan/asan_interceptors.cpp
@@ -58,7 +58,7 @@ namespace __asan {
static inline uptr MaybeRealStrnlen(const char *s, uptr maxlen) {
#if SANITIZER_INTERCEPT_STRNLEN
- if (REAL(strnlen) != nullptr)
+ if (static_cast<bool>(REAL(strnlen)))
return REAL(strnlen)(s, maxlen);
# endif
return internal_strnlen(s, maxlen);
@@ -66,7 +66,7 @@ static inline uptr MaybeRealStrnlen(const char *s, uptr maxlen) {
static inline uptr MaybeRealWcsnlen(const wchar_t* s, uptr maxlen) {
# if SANITIZER_INTERCEPT_WCSNLEN
- if (REAL(wcsnlen) != nullptr)
+ if (static_cast<bool>(REAL(wcsnlen)))
return REAL(wcsnlen)(s, maxlen);
# endif
return internal_wcsnlen(s, maxlen);
|
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/21206 Here is the relevant piece of the build log for the reference |
llvm#164906 converted a -Wpointer-bool-conversion warning into a -Wtautological-pointer-compare warning. Avoid both by using the bool cast.
llvm#164906 converted a -Wpointer-bool-conversion warning into a -Wtautological-pointer-compare warning. Avoid both by using the bool cast.
llvm#164906 converted a -Wpointer-bool-conversion warning into a -Wtautological-pointer-compare warning. Avoid both by using the bool cast.
#164906 converted a -Wpointer-bool-conversion warning into a -Wtautological-pointer-compare warning. Avoid both by using the bool cast.