Skip to content

Commit 48bea27

Browse files
committed
[PR] vitalybuka - Fix warnings so build machines stay happy
1 parent 3507e33 commit 48bea27

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

compiler-rt/lib/rtsan/tests/rtsan_test_functional.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ TEST(TestRtsan, CopyingALambdaWithLargeCaptureDiesWhenRealtime) {
145145
auto lambda = [lots_of_data]() mutable {
146146
// Stop everything getting optimised out
147147
lots_of_data[3] = 0.25f;
148-
EXPECT_EQ(16, lots_of_data.size());
148+
EXPECT_EQ(16u, lots_of_data.size());
149149
EXPECT_EQ(0.25f, lots_of_data[3]);
150150
};
151151
auto Func = [&]() { InvokeStdFunction(lambda); };
@@ -156,11 +156,17 @@ TEST(TestRtsan, CopyingALambdaWithLargeCaptureDiesWhenRealtime) {
156156
TEST(TestRtsan, AccessingALargeAtomicVariableDiesWhenRealtime) {
157157
std::atomic<float> small_atomic{0.0f};
158158
ASSERT_TRUE(small_atomic.is_lock_free());
159-
RealtimeInvoke([&small_atomic]() { float x = small_atomic.load(); });
159+
RealtimeInvoke([&small_atomic]() {
160+
float x = small_atomic.load();
161+
return x;
162+
});
160163

161164
std::atomic<std::array<float, 2048>> large_atomic;
162165
ASSERT_FALSE(large_atomic.is_lock_free());
163-
auto Func = [&]() { auto x = large_atomic.load(); };
166+
auto Func = [&]() {
167+
std::array<float, 2048> x = large_atomic.load();
168+
return x;
169+
};
164170
ExpectRealtimeDeath(Func);
165171
ExpectNonRealtimeSurvival(Func);
166172
}

compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ TEST(TestRtsanInterceptors, PthreadCreateDiesWhenRealtime) {
321321
auto Func = []() {
322322
pthread_t thread{};
323323
const pthread_attr_t attr{};
324-
struct thread_info *thread_info;
324+
struct thread_info *thread_info{};
325325
pthread_create(&thread, &attr, &FakeThreadEntryPoint, thread_info);
326326
};
327327
ExpectRealtimeDeath(Func, "pthread_create");

0 commit comments

Comments
 (0)