Merge "Mark variables as unused."
diff --git a/tests/sys_ttydefaults_test.cpp b/tests/sys_ttydefaults_test.cpp
index fa4f7c7..73aa448 100644
--- a/tests/sys_ttydefaults_test.cpp
+++ b/tests/sys_ttydefaults_test.cpp
@@ -20,7 +20,7 @@
#include <termios.h>
TEST(sys_ttydefaults, flags) {
- int i;
+ [[maybe_unused]] int i;
i = TTYDEF_IFLAG;
i = TTYDEF_OFLAG;
i = TTYDEF_LFLAG;
diff --git a/tests/unistd_test.cpp b/tests/unistd_test.cpp
index 840dad0..c306a08 100644
--- a/tests/unistd_test.cpp
+++ b/tests/unistd_test.cpp
@@ -688,9 +688,9 @@
__attribute__((noinline)) static void HwasanReadMemory(const char* p, size_t size) {
// Read memory byte-by-byte. This will blow up if the pointer tag in p does not match any memory
// tag in [p, p+size).
- volatile char z;
+ char z;
for (size_t i = 0; i < size; ++i) {
- z = p[i];
+ DoNotOptimize(z = p[i]);
}
}