Merge pull request #3570 from sfc-gh-anoyes/anoyes/enable-Wall-Wextra
Re-enable -Wall -Wextra for clang
This commit is contained in:
commit
6b28687c65
|
@ -237,6 +237,7 @@ else()
|
||||||
-Wno-unknown-attributes)
|
-Wno-unknown-attributes)
|
||||||
endif()
|
endif()
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
|
-Wall -Wextra
|
||||||
# Here's the current set of warnings we need to explicitly disable to compile warning-free with clang 10
|
# Here's the current set of warnings we need to explicitly disable to compile warning-free with clang 10
|
||||||
-Wno-comment
|
-Wno-comment
|
||||||
-Wno-dangling-else
|
-Wno-dangling-else
|
||||||
|
|
|
@ -233,7 +233,7 @@ struct MutationFilesReadProgress : public ReferenceCounted<MutationFilesReadProg
|
||||||
|
|
||||||
void dumpProgress(std::string msg) {
|
void dumpProgress(std::string msg) {
|
||||||
std::cout << msg << "\n ";
|
std::cout << msg << "\n ";
|
||||||
for (const auto fp : fileProgress) {
|
for (const auto& fp : fileProgress) {
|
||||||
std::cout << fp->fd->getFilename() << " " << fp->mutations.size() << " mutations";
|
std::cout << fp->fd->getFilename() << " " << fp->mutations.size() << " mutations";
|
||||||
if (fp->mutations.size() > 0) {
|
if (fp->mutations.size() > 0) {
|
||||||
std::cout << ", range " << fp->mutations[0].version.toString() << " "
|
std::cout << ", range " << fp->mutations[0].version.toString() << " "
|
||||||
|
|
|
@ -1214,7 +1214,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// for each range in tags, check all tags from 1 are continouous
|
// for each range in tags, check all tags from 1 are continouous
|
||||||
for (const auto [beginEnd, count] : tags) {
|
for (const auto& [beginEnd, count] : tags) {
|
||||||
for (int i = 1; i < count; i++) {
|
for (int i = 1; i < count; i++) {
|
||||||
if (!isContinuous(files, tagIndices[i], beginEnd.first, std::min(beginEnd.second - 1, end), nullptr)) {
|
if (!isContinuous(files, tagIndices[i], beginEnd.first, std::min(beginEnd.second - 1, end), nullptr)) {
|
||||||
TraceEvent(SevWarn, "BackupFileNotContinuous")
|
TraceEvent(SevWarn, "BackupFileNotContinuous")
|
||||||
|
@ -1317,7 +1317,7 @@ public:
|
||||||
|
|
||||||
// for each range in tags, check all partitions from 1 are continouous
|
// for each range in tags, check all partitions from 1 are continouous
|
||||||
Version lastEnd = begin;
|
Version lastEnd = begin;
|
||||||
for (const auto [beginEnd, count] : tags) {
|
for (const auto& [beginEnd, count] : tags) {
|
||||||
Version tagEnd = beginEnd.second; // This range's minimum continous partition version
|
Version tagEnd = beginEnd.second; // This range's minimum continous partition version
|
||||||
for (int i = 1; i < count; i++) {
|
for (int i = 1; i < count; i++) {
|
||||||
std::map<std::pair<Version, Version>, int> rangeTags;
|
std::map<std::pair<Version, Version>, int> rangeTags;
|
||||||
|
|
|
@ -339,7 +339,7 @@ namespace ThrottleApi {
|
||||||
loop {
|
loop {
|
||||||
try {
|
try {
|
||||||
Optional<Value> value = wait(tr.get(tagThrottleAutoEnabledKey));
|
Optional<Value> value = wait(tr.get(tagThrottleAutoEnabledKey));
|
||||||
if(!value.present() || (enabled && value.get() != LiteralStringRef("1") || (!enabled && value.get() != LiteralStringRef("0")))) {
|
if (!value.present() || (enabled && value.get() != LiteralStringRef("1")) || (!enabled && value.get() != LiteralStringRef("0"))) {
|
||||||
tr.set(tagThrottleAutoEnabledKey, LiteralStringRef(enabled ? "1" : "0"));
|
tr.set(tagThrottleAutoEnabledKey, LiteralStringRef(enabled ? "1" : "0"));
|
||||||
signalThrottleChange(tr);
|
signalThrottleChange(tr);
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ TEST_CASE("/BackupProgress/Unfinished") {
|
||||||
std::map<std::tuple<LogEpoch, Version, int>, std::map<Tag, Version>> unfinished = progress.getUnfinishedBackup();
|
std::map<std::tuple<LogEpoch, Version, int>, std::map<Tag, Version>> unfinished = progress.getUnfinishedBackup();
|
||||||
|
|
||||||
ASSERT(unfinished.size() == 1);
|
ASSERT(unfinished.size() == 1);
|
||||||
for (const auto [epochVersionCount, tagVersion] : unfinished) {
|
for (const auto& [epochVersionCount, tagVersion] : unfinished) {
|
||||||
ASSERT(std::get<0>(epochVersionCount) == epoch1 && std::get<1>(epochVersionCount) == end1 &&
|
ASSERT(std::get<0>(epochVersionCount) == epoch1 && std::get<1>(epochVersionCount) == end1 &&
|
||||||
std::get<2>(epochVersionCount) == 1);
|
std::get<2>(epochVersionCount) == 1);
|
||||||
ASSERT(tagVersion.size() == 1 && tagVersion.begin()->first == tag1 && tagVersion.begin()->second == begin1);
|
ASSERT(tagVersion.size() == 1 && tagVersion.begin()->first == tag1 && tagVersion.begin()->second == begin1);
|
||||||
|
@ -195,7 +195,7 @@ TEST_CASE("/BackupProgress/Unfinished") {
|
||||||
progress.addBackupStatus(status1);
|
progress.addBackupStatus(status1);
|
||||||
unfinished = progress.getUnfinishedBackup();
|
unfinished = progress.getUnfinishedBackup();
|
||||||
ASSERT(unfinished.size() == 1);
|
ASSERT(unfinished.size() == 1);
|
||||||
for (const auto [epochVersionCount, tagVersion] : unfinished) {
|
for (const auto& [epochVersionCount, tagVersion] : unfinished) {
|
||||||
ASSERT(std::get<0>(epochVersionCount) == epoch1 && std::get<1>(epochVersionCount) == end1 &&
|
ASSERT(std::get<0>(epochVersionCount) == epoch1 && std::get<1>(epochVersionCount) == end1 &&
|
||||||
std::get<2>(epochVersionCount) == 1);
|
std::get<2>(epochVersionCount) == 1);
|
||||||
ASSERT(tagVersion.size() == 1 && tagVersion.begin()->first == tag1 && tagVersion.begin()->second == saved1 + 1);
|
ASSERT(tagVersion.size() == 1 && tagVersion.begin()->first == tag1 && tagVersion.begin()->second == saved1 + 1);
|
||||||
|
|
|
@ -45,8 +45,8 @@ struct VersionedMessage {
|
||||||
|
|
||||||
VersionedMessage(LogMessageVersion v, StringRef m, const VectorRef<Tag>& t, const Arena& a)
|
VersionedMessage(LogMessageVersion v, StringRef m, const VectorRef<Tag>& t, const Arena& a)
|
||||||
: version(v), message(m), tags(t), arena(a), bytes(a.getSize()) {}
|
: version(v), message(m), tags(t), arena(a), bytes(a.getSize()) {}
|
||||||
const Version getVersion() const { return version.version; }
|
Version getVersion() const { return version.version; }
|
||||||
const uint32_t getSubVersion() const { return version.sub; }
|
uint32_t getSubVersion() const { return version.sub; }
|
||||||
|
|
||||||
// Returns true if the message is a mutation that should be backuped, i.e.,
|
// Returns true if the message is a mutation that should be backuped, i.e.,
|
||||||
// either key is not in system key space or is not a metadataVersionKey.
|
// either key is not in system key space or is not a metadataVersionKey.
|
||||||
|
@ -367,7 +367,7 @@ struct BackupData {
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
bool minVersionChanged = false;
|
bool minVersionChanged = false;
|
||||||
Version minVersion = std::numeric_limits<Version>::max();
|
Version minVersion = std::numeric_limits<Version>::max();
|
||||||
for (const auto [uid, version] : uidVersions) {
|
for (const auto& [uid, version] : uidVersions) {
|
||||||
auto it = backups.find(uid);
|
auto it = backups.find(uid);
|
||||||
if (it == backups.end()) {
|
if (it == backups.end()) {
|
||||||
modified = true;
|
modified = true;
|
||||||
|
|
|
@ -454,7 +454,7 @@ struct ProxyCommitData {
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool needsCacheTag(KeyRangeRef range) {
|
bool needsCacheTag(KeyRangeRef range) {
|
||||||
auto ranges = cacheInfo.intersectingRanges(range);
|
auto ranges = cacheInfo.intersectingRanges(range);
|
||||||
for(auto r : ranges) {
|
for(auto r : ranges) {
|
||||||
if(r.value()) {
|
if(r.value()) {
|
||||||
|
|
|
@ -764,7 +764,6 @@ public:
|
||||||
Version currentVersion;
|
Version currentVersion;
|
||||||
private:
|
private:
|
||||||
KeyRef cacheStartKey;
|
KeyRef cacheStartKey;
|
||||||
bool nowAssigned;
|
|
||||||
bool processedCacheStartKey;
|
bool processedCacheStartKey;
|
||||||
|
|
||||||
// Applies private mutations, as the name suggests. It's basically establishes the key-ranges
|
// Applies private mutations, as the name suggests. It's basically establishes the key-ranges
|
||||||
|
|
|
@ -100,7 +100,7 @@ void treeBenchmark(T& tree, F generateKey) {
|
||||||
keys.resize(std::unique(keys.begin(), keys.end()) - keys.begin());
|
keys.resize(std::unique(keys.begin(), keys.end()) - keys.begin());
|
||||||
|
|
||||||
auto iter = tree.lower_bound(*keys.begin());
|
auto iter = tree.lower_bound(*keys.begin());
|
||||||
timedRun("scan", keys, [&tree, &iter](key const& k) {
|
timedRun("scan", keys, [&iter](key const& k) {
|
||||||
ASSERT(k == *iter);
|
ASSERT(k == *iter);
|
||||||
++iter;
|
++iter;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue