New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unused MSVC compiler warning supressions #12205
Conversation
@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1 similar comment
@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b4c089c
to
f698018
Compare
@rhubner has updated the pull request. You must reimport the pull request before landing. |
4 similar comments
@rhubner has updated the pull request. You must reimport the pull request before landing. |
@rhubner has updated the pull request. You must reimport the pull request before landing. |
@rhubner has updated the pull request. You must reimport the pull request before landing. |
@rhubner has updated the pull request. You must reimport the pull request before landing. |
3438167
to
e9967a3
Compare
@rhubner has updated the pull request. You must reimport the pull request before landing. |
@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
e9967a3
to
2e4a811
Compare
@rhubner has updated the pull request. You must reimport the pull request before landing. |
1 similar comment
@rhubner has updated the pull request. You must reimport the pull request before landing. |
51db246
to
e80848a
Compare
@rhubner has updated the pull request. You must reimport the pull request before landing. |
2 similar comments
@rhubner has updated the pull request. You must reimport the pull request before landing. |
@rhubner has updated the pull request. You must reimport the pull request before landing. |
util/ribbon_impl.h
Outdated
@@ -569,10 +569,17 @@ class StandardBanding : public StandardHasher<TypesAndSettings> { | |||
template <typename InputIterator> | |||
bool AddRange(InputIterator begin, InputIterator end) { | |||
assert(num_starts_ > 0 || TypesAndSettings::kAllowZeroStarts); | |||
#if defined(_MSC_VER) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just exempting the whole file?
util/math.h
Outdated
return static_cast<T>(_byteswap_uint64(static_cast<uint64_t>(v))); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditional compilation is easier to reason about with whole statements (or declarations or expressions). Sometimes called "syntactic confinement." IMHO early return is a lesser evil.
db/db_write_test.cc
Outdated
@@ -21,6 +21,10 @@ | |||
#include "utilities/fault_injection_env.h" | |||
#include "utilities/fault_injection_fs.h" | |||
|
|||
#ifdef OS_WIN | |||
#define sleep(x) Sleep(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about port_win.h?
db/db_test_util.cc
Outdated
@@ -352,7 +352,18 @@ Options DBTestBase::GetOptions( | |||
"NewWritableFile:O_DIRECT"); | |||
#endif | |||
// kMustFreeHeapAllocations -> indicates ASAN build | |||
|
|||
#if defined(__has_feature) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be the ugliest hack job I've seen to work around a compiler warning.
You could wrap the whole if (
in
// (Work around MSVC compiler warning)
#if !defined(_MSC_VER) || defined(MUST_FREE_HEAP_ALLOCATIONS)
Or better use the pragma warning disable recipe
util/ribbon_test.cc
Outdated
ROCKSDB_GTEST_BYPASS("Not fully supported"); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this is a clear case of early return improving readability by reducing indent depth and apparent complexity. (You want to add indent to 400+ lines of code for this?)
Or does the 4127 warning preclude unreachable code after a constexpr early return? It sounds like a very bad warning. What's wrong with having it disabled globally? If you don't want it disabled in the build why not disable semi-globally in port_win.h or lang.h?
96bfbe3
to
8539e5b
Compare
@rhubner has updated the pull request. You must reimport the pull request before landing. |
@pdillinger thanks for comments. I removed all the |
@rhubner has updated the pull request. You must reimport the pull request before landing. |
FWIW, I want those fixes to be committed atomically with fixing the Windows CI. Then we can look at tightening the warnings. |
8b0819f
to
085cde9
Compare
@rhubner has updated the pull request. You must reimport the pull request before landing. |
085cde9
to
7958c22
Compare
@rhubner has updated the pull request. You must reimport the pull request before landing. |
@ajkr has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Remove unused compiler warning supressions as was suggested in #10745.
Fixes #10745