Skip to content

Commit

Permalink
cleanup boost relics in CommonSetup.cmake.
Browse files Browse the repository at this point in the history
Fix bugs found by clang
  • Loading branch information
lovettchris committed Apr 23, 2017
1 parent 772e7c3 commit 3673979
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion MavLinkCom/MavLinkTest/Commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2556,7 +2556,7 @@ void FtpCommand::doPut() {
void FtpCommand::doRemove() {
std::string fsTarget = normalize(target);
std::string leaf = FileSystem::getFileName(fsTarget);
if (leaf.size() > 0 && leaf[0] == '/' || leaf[0] == '\\') {
if (leaf.size() > 0 && (leaf[0] == '/' || leaf[0] == '\\')) {
leaf = leaf.substr(1);
}
bool wildcards = false;
Expand Down
2 changes: 1 addition & 1 deletion MavLinkCom/src/impl/MavLinkFtpClientImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ void MavLinkFtpClientImpl::handleResponse(const MavLinkMessage& msg)
{
success_ = false;
if (progress_ != nullptr) {
if (error = kErrFailErrno) {
if (error == kErrFailErrno) {
const uint8_t* data = &(payload->data);
error = static_cast<int>(data[1]);
progress_->error = error;
Expand Down
6 changes: 3 additions & 3 deletions cmake/cmake-modules/CommonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ macro(CommonSetup)

IF(UNIX)
## I had to remove the following for Eigen to build properly: -Wlogical-op -Wsign-promo
## boost does not built cleam, so I had to disable these checks:
set(BOOST_OVERRIDES " -Wno-error=undef -Wno-error=ctor-dtor-privacy -Wno-error=old-style-cast -Wno-error=shadow -Wno-error=redundant-decls -Wno-error=missing-field-initializers -Wno-error=unused-parameter")
set(AIRLIB_OVERRIDES " -Wno-error=unused-parameter")
## Mavlink requires turning off -pedantic and -Wno-error=switch-default
set(MAVLINK_OVERRIDES "-Wno-error=switch-default ")
set(RPC_LIB_DEFINES "-D MSGPACK_PP_VARIADICS_MSVC=0")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__CLANG__")
else ()
##TODO: Werror removed temporarily. It should be added back after Linux build is stable
set(CMAKE_CXX_FLAGS "-std=c++14 -ggdb -Wall -Wextra -Wstrict-aliasing -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option ${MAVLINK_OVERRIDES} ${BOOST_OVERRIDES} ${RPC_LIB_DEFINES} ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-std=c++14 -ggdb -Wall -Wextra -Wstrict-aliasing -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option ${MAVLINK_OVERRIDES} ${AIRLIB_OVERRIDES} ${RPC_LIB_DEFINES} ${CMAKE_CXX_FLAGS}")

if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
# make sure to match the compiler flags with which the Unreal
Expand Down

0 comments on commit 3673979

Please sign in to comment.