mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Fixed warnings reported by Clang on Windows.
This commit is contained in:
@@ -2,13 +2,14 @@ msvc:DEFINES *= _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
# swift standard warnings
|
||||
msvc:QMAKE_CXXFLAGS_WARN_ON *= /wd4351 /wd4661
|
||||
clang_cl:QMAKE_CXXFLAGS_WARN_ON *= -Wall -Wextra -Wno-unknown-pragmas -Wno-undefined-inline
|
||||
clang_cl:QMAKE_CXXFLAGS_WARN_ON *= -Wall -Wextra -Wno-unknown-pragmas -Wno-undefined-inline -Wno-self-assign-overloaded
|
||||
gcc:QMAKE_CXXFLAGS_WARN_ON *= -Woverloaded-virtual
|
||||
gcc:QMAKE_CXXFLAGS_USE_PRECOMPILE = -Winvalid-pch $$QMAKE_CXXFLAGS_USE_PRECOMPILE
|
||||
|
||||
# elevated warnings
|
||||
swiftConfig(allowNoisyWarnings) {
|
||||
clang {
|
||||
QMAKE_CXXFLAGS_WARN_ON -= -Wno-self-assign-overloaded
|
||||
QMAKE_CXXFLAGS_WARN_ON *= -Weverything --system-header-prefix=$$[QT_INSTALL_HEADERS]
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Wno-system-headers -Wno-c++98-compat-pedantic -Wno-class-varargs -Wno-covered-switch-default
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Wno-documentation -Wno-documentation-unknown-command -Wno-double-promotion -Wno-exit-time-destructors
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace BlackMisc
|
||||
int remove(const T &object)
|
||||
{
|
||||
const auto newEnd = std::remove(begin(), end(), object);
|
||||
int count = std::distance(newEnd, end());
|
||||
const auto count = std::distance(newEnd, end());
|
||||
erase(newEnd, end());
|
||||
return count;
|
||||
}
|
||||
@@ -300,8 +300,8 @@ namespace BlackMisc
|
||||
template <class Predicate>
|
||||
int removeIf(Predicate p)
|
||||
{
|
||||
auto newEnd = std::remove_if(begin(), end(), p);
|
||||
int count = std::distance(newEnd, end());
|
||||
const auto newEnd = std::remove_if(begin(), end(), p);
|
||||
const auto count = std::distance(newEnd, end());
|
||||
erase(newEnd, end());
|
||||
return count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user