Skip to content

Commit

Permalink
Fix some compiler warnings (#179)
Browse files Browse the repository at this point in the history
- Correct usage of ADD_WARNINGS_CONFIGURATION_TO_TARGETS macro
- Addressed compiler warnings
- Bump Catch2 version in GitHub CI to 3.8.0
  • Loading branch information
pauldreik authored Jan 7, 2025
1 parent db34a00 commit 3fc702c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
env:
osqp_TAG: v0.6.3
vcpkg_robotology_TAG: v0.0.3
Catch2_TAG: v3.0.1
Catch2_TAG: v3.8.0
# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by GitHub Actions to point to our vcpkg
VCPKG_INSTALLATION_ROOT: C:\robotology\vcpkg

Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ add_library(${LIBRARY_TARGET_NAME} ${${LIBRARY_TARGET_NAME}_SRC} ${${LIBRARY_TAR
target_include_directories(${LIBRARY_TARGET_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")

ADD_WARNINGS_CONFIGURATION_TO_TARGETS(PRIVATE TARGETS ${LIBRARY_TARGET_NAME})

target_link_libraries(${LIBRARY_TARGET_NAME} PUBLIC osqp::osqp Eigen3::Eigen)
if(OSQP_IS_V1)
target_compile_definitions(${LIBRARY_TARGET_NAME} PUBLIC OSQP_EIGEN_OSQP_IS_V1)
Expand Down
2 changes: 1 addition & 1 deletion include/OsqpEigen/Solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class Solver
* Get the primal objective value
* @return The primal objective value
*/
const c_float getObjValue() const;
c_float getObjValue() const;

/**
* Get the optimization problem solution.
Expand Down
2 changes: 1 addition & 1 deletion src/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class NullStream : public std::ostream
}
};

template <class T> const NullStream& operator<<(NullStream&& os, const T& value)
template <class T> const NullStream& operator<<(NullStream&& os, const T&)
{
return os;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ OsqpEigen::Status OsqpEigen::Solver::getStatus() const
return static_cast<OsqpEigen::Status>(getInfo()->status_val);
}

const c_float OsqpEigen::Solver::getObjValue() const
c_float OsqpEigen::Solver::getObjValue() const
{
return getInfo()->obj_val;
}
Expand Down

0 comments on commit 3fc702c

Please sign in to comment.