ART: Enable bugprone-unused-return-value
Enable bugprone-unused-return-value as an error. This is on top of
the compiler warning for attribute((warn_unused)).
Mark the current occurrences (all unique_ptr.release()) with NOLINT
to signal that we know what we're doing.
Bug: 32619234
Bug: 117926937
Test: WITH_TIDY=1 mmma art
Change-Id: I36659722335eef36acfa5845289104257a393874
diff --git a/adbconnection/adbconnection.cc b/adbconnection/adbconnection.cc
index c716d92..2050133 100644
--- a/adbconnection/adbconnection.cc
+++ b/adbconnection/adbconnection.cc
@@ -251,6 +251,8 @@
runtime->StartThreadBirth();
}
ScopedLocalRef<jobject> thr(soa.Env(), CreateAdbConnectionThread(soa.Self()));
+ // Note: Using pthreads instead of std::thread to not abort when the thread cannot be
+ // created (exception support required).
pthread_t pthread;
std::unique_ptr<CallbackData> data(new CallbackData { this, soa.Env()->NewGlobalRef(thr.get()) });
started_debugger_threads_ = true;
@@ -268,7 +270,7 @@
runtime->EndThreadBirth();
return;
}
- data.release();
+ data.release(); // NOLINT pthreads API.
}
static bool FlagsSet(int16_t data, int16_t flags) {