From a16d0cc494ea8853b84c606efc04b61e33878fff Mon Sep 17 00:00:00 2001 From: Levi Tamasi Date: Fri, 7 Jun 2019 19:34:48 -0700 Subject: [PATCH] Fix build errors regarding const qualifier being ignored on cast result type (#5432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: This affects some TSAN builds: env/env_test.cc: In member function ‘virtual void rocksdb::EnvPosixTestWithParam_MultiRead_Test::TestBody()’: env/env_test.cc:1126:76: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers] auto data = NewAligned(kSectorSize * 8, static_cast(i + 1)); ^ env/env_test.cc:1154:77: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers] auto buf = NewAligned(kSectorSize * 8, static_cast(i*2 + 1)); ^ Pull Request resolved: https://github.com/facebook/rocksdb/pull/5432 Differential Revision: D15727277 Pulled By: ltamasi fbshipit-source-id: dc0e687b123e7c4d703ccc0c16b7167e07d1c9b0 --- env/env_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/env/env_test.cc b/env/env_test.cc index a2b6db5c47..6f225e37f6 100644 --- a/env/env_test.cc +++ b/env/env_test.cc @@ -1123,7 +1123,7 @@ TEST_P(EnvPosixTestWithParam, MultiRead) { #endif ASSERT_OK(env_->NewWritableFile(fname, &wfile, soptions)); for (size_t i = 0; i < kNumSectors; ++i) { - auto data = NewAligned(kSectorSize * 8, static_cast(i + 1)); + auto data = NewAligned(kSectorSize * 8, static_cast(i + 1)); Slice slice(data.get(), kSectorSize); ASSERT_OK(wfile->Append(slice)); } @@ -1151,7 +1151,7 @@ TEST_P(EnvPosixTestWithParam, MultiRead) { ASSERT_OK(env_->NewRandomAccessFile(fname, &file, soptions)); ASSERT_OK(file->MultiRead(reqs.data(), reqs.size())); for (size_t i = 0; i < reqs.size(); ++i) { - auto buf = NewAligned(kSectorSize * 8, static_cast(i*2 + 1)); + auto buf = NewAligned(kSectorSize * 8, static_cast(i*2 + 1)); ASSERT_OK(reqs[i].status); ASSERT_EQ(memcmp(reqs[i].scratch, buf.get(), kSectorSize), 0); }