Skip to content
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

Address more warnings #605

Merged
merged 25 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c2143a1
Ignore deprecation warnings in tests
wxmerkt Jun 29, 2024
48d9c06
fwd.hh: Add HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_MAYBE_UNINITIALIZED
wxmerkt Jun 29, 2024
e2c3a3a
Address Wmaybe-uninitialized
wxmerkt Jun 29, 2024
53b25d6
Address more Wpedantic
wxmerkt Jun 29, 2024
383f912
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 29, 2024
32f1ffa
Fix HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_MAYBE_UNINITIALIZED
wxmerkt Jun 29, 2024
6d97e94
Update CHANGELOG
wxmerkt Jun 29, 2024
31bdc37
[CI] Reactivate Rolling
wxmerkt Jun 29, 2024
7b5409b
Merge branch 'topic/more-warnings' of github.com:wxmerkt/hpp-fcl into…
wxmerkt Jun 29, 2024
1024157
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 29, 2024
5461edf
[CI] Disable Rolling again, still failing
wxmerkt Jun 30, 2024
6d9f48d
Merge branch 'topic/more-warnings' of github.com:wxmerkt/hpp-fcl into…
wxmerkt Jun 30, 2024
ed1ffe9
Fix macro check build failure
wxmerkt Jun 30, 2024
aea8a7d
Change to logic that works with both gcc and clang
wxmerkt Jun 30, 2024
c32e77d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 30, 2024
23a4cad
Another attempt at fixing the macro checks
wxmerkt Jun 30, 2024
ab87e20
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 30, 2024
2be2dc1
Fix macro with gcc
wxmerkt Jun 30, 2024
68767da
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 30, 2024
3f887e7
One more pedantic
wxmerkt Jun 30, 2024
853d5ee
Conversion (template parameter type matching)
wxmerkt Jun 30, 2024
8aade7e
URL fix
wxmerkt Jun 30, 2024
c2f0aa3
Fix gcc Wconversion in macro
wxmerkt Jun 30, 2024
ea90840
Merge branch 'topic/more-warnings' of github.com:wxmerkt/hpp-fcl into…
wxmerkt Jun 30, 2024
e12c707
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ros_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
- {ROS_DISTRO: noetic}
- {ROS_DISTRO: iron}
- {ROS_DISTRO: humble}
#- {ROS_DISTRO: rolling, PRERELEASE: false} # 2024-04-02: turn off prerelease until Noble is stable; turned off entirely until eigenpy is available
#- {ROS_DISTRO: rolling}
env:
#CCACHE_DIR: /github/home/.ccache # Enable ccache
BUILDER: colcon
PRERELEASE: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
# This step will fetch/store the directory used by ccache before/after the ci run
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed

- Compiler warnings ([#601](https://github.com/humanoid-path-planner/hpp-fcl/pull/601))
- Compiler warnings ([#601](https://github.com/humanoid-path-planner/hpp-fcl/pull/601), [#605](https://github.com/humanoid-path-planner/hpp-fcl/pull/605))
- CMake: fix assimp finder
- Don't define GCC7 Boost serialization hack when `HPP_FCL_SKIP_EIGEN_BOOST_SERIALIZATION` is defined ([#530](https://github.com/humanoid-path-planner/hpp-fcl/pull/530))
- Default parameters for narrowphase algorithms (GJK and EPA); fixed assertion checks that were sometimes failing in GJK simplex projection and BVH `collide` ([#531](https://github.com/humanoid-path-planner/hpp-fcl/pull/531)).
Expand Down
9 changes: 9 additions & 0 deletions include/hpp/fcl/fwd.hh
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,24 @@
#define HPP_FCL_COMPILER_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#if !defined(__has_warning) || __has_warning("-Wmaybe-uninitialized")
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_MAYBE_UNINITIALIZED \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
#else
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_MAYBE_UNINITIALIZED
#endif
#elif defined(WIN32)
#define HPP_FCL_COMPILER_DIAGNOSTIC_PUSH _Pragma("warning(push)")
#define HPP_FCL_COMPILER_DIAGNOSTIC_POP _Pragma("warning(pop)")
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS \
_Pragma("warning(disable : 4996)")
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_MAYBE_UNINITIALIZED \
_Pragma("warning(disable : 4700)")
#else
#define HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
#define HPP_FCL_COMPILER_DIAGNOSTIC_POP
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
#define HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_MAYBE_UNINITIALIZED
#endif // __GNUC__

namespace hpp {
Expand Down
5 changes: 5 additions & 0 deletions include/hpp/fcl/internal/traversal_node_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,14 @@ bool initialize(MeshDistanceTraversalNode<BV, 0>& node,
node.tri_indices2 =
model2.tri_indices.get() ? model2.tri_indices->data() : NULL;

HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_MAYBE_UNINITIALIZED

relativeTransform(tf1.getRotation(), tf1.getTranslation(), tf2.getRotation(),
tf2.getTranslation(), node.RT.R, node.RT.T);

HPP_FCL_COMPILER_DIAGNOSTIC_POP

return true;
}

Expand Down
36 changes: 27 additions & 9 deletions src/narrowphase/support_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,15 @@ void getShapeSupportSet(const TriangleP* triangle, SupportSet& support_set,
}
}
}
getShapeSupportSetTplInstantiation(TriangleP);
// clang-format off
getShapeSupportSetTplInstantiation(TriangleP)

// ============================================================================
template <int _SupportOptions>
void getShapeSupportSet(const Box* box, SupportSet& support_set,
int& hint /*unused*/, ShapeSupportData& support_data,
size_t /*unused*/, FCL_REAL tol) {
// clang-format on
assert(tol > 0);
Vec3f support;
const Vec3f& support_dir = support_set.getNormal();
Expand Down Expand Up @@ -612,14 +614,16 @@ void getShapeSupportSet(const Box* box, SupportSet& support_set,
}
computeSupportSetConvexHull(polygon, support_set.points());
}
getShapeSupportSetTplInstantiation(Box);
// clang-format off
getShapeSupportSetTplInstantiation(Box)

// ============================================================================
template <int _SupportOptions>
void getShapeSupportSet(const Sphere* sphere, SupportSet& support_set,
int& hint /*unused*/,
ShapeSupportData& support_data /*unused*/,
size_t /*unused*/, FCL_REAL /*unused*/) {
// clang-format on
support_set.points().clear();

Vec3f support;
Expand All @@ -628,13 +632,15 @@ void getShapeSupportSet(const Sphere* sphere, SupportSet& support_set,
support_data);
support_set.addPoint(support);
}
getShapeSupportSetTplInstantiation(Sphere);
// clang-format off
getShapeSupportSetTplInstantiation(Sphere)

// ============================================================================
template <int _SupportOptions>
void getShapeSupportSet(const Ellipsoid* ellipsoid, SupportSet& support_set,
int& hint, ShapeSupportData& support_data /*unused*/,
size_t /*unused*/, FCL_REAL /*unused*/) {
// clang-format on
support_set.points().clear();

Vec3f support;
Expand All @@ -643,14 +649,16 @@ void getShapeSupportSet(const Ellipsoid* ellipsoid, SupportSet& support_set,
support_data);
support_set.addPoint(support);
}
getShapeSupportSetTplInstantiation(Ellipsoid);
// clang-format off
getShapeSupportSetTplInstantiation(Ellipsoid)

// ============================================================================
template <int _SupportOptions>
void getShapeSupportSet(const Capsule* capsule, SupportSet& support_set,
int& hint /*unused*/,
ShapeSupportData& support_data /*unused*/,
size_t /*unused*/, FCL_REAL tol) {
// clang-format on
assert(tol > 0);
support_set.points().clear();

Expand Down Expand Up @@ -686,14 +694,16 @@ void getShapeSupportSet(const Capsule* capsule, SupportSet& support_set,
}
}
}
getShapeSupportSetTplInstantiation(Capsule);
// clang-format off
getShapeSupportSetTplInstantiation(Capsule)

// ============================================================================
template <int _SupportOptions>
void getShapeSupportSet(const Cone* cone, SupportSet& support_set,
int& hint /*unused*/,
ShapeSupportData& support_data /*unused*/,
size_t num_sampled_supports, FCL_REAL tol) {
// clang-format on
assert(tol > 0);
support_set.points().clear();

Expand Down Expand Up @@ -757,14 +767,16 @@ void getShapeSupportSet(const Cone* cone, SupportSet& support_set,
}
}
}
getShapeSupportSetTplInstantiation(Cone);
// clang-format off
getShapeSupportSetTplInstantiation(Cone)

// ============================================================================
template <int _SupportOptions>
void getShapeSupportSet(const Cylinder* cylinder, SupportSet& support_set,
int& hint /*unused*/,
ShapeSupportData& support_data /*unused*/,
size_t num_sampled_supports, FCL_REAL tol) {
// clang-format on
assert(tol > 0);
support_set.points().clear();

Expand Down Expand Up @@ -819,14 +831,16 @@ void getShapeSupportSet(const Cylinder* cylinder, SupportSet& support_set,
}
}
}
getShapeSupportSetTplInstantiation(Cylinder);
// clang-format off
getShapeSupportSetTplInstantiation(Cylinder)

// ============================================================================
template <int _SupportOptions>
void getShapeSupportSetLinear(const ConvexBase* convex, SupportSet& support_set,
int& hint /*unused*/,
ShapeSupportData& support_data, size_t /*unused*/,
FCL_REAL tol) {
// clang-format on
assert(tol > 0);
Vec3f support;
const Vec3f& support_dir = support_set.getNormal();
Expand Down Expand Up @@ -943,25 +957,29 @@ void getShapeSupportSet(const ConvexBase* convex, SupportSet& support_set,
convex, support_set, hint, support_data, num_sampled_supports, tol);
}
}
getShapeSupportSetTplInstantiation(ConvexBase);
// clang-format off
getShapeSupportSetTplInstantiation(ConvexBase)

// ============================================================================
template <int _SupportOptions>
void getShapeSupportSet(const SmallConvex* convex, SupportSet& support_set,
int& hint /*unused*/,
ShapeSupportData& support_data /*unused*/,
size_t num_sampled_supports /*unused*/, FCL_REAL tol) {
// clang-format on
getShapeSupportSetLinear<_SupportOptions>(
reinterpret_cast<const ConvexBase*>(convex), support_set, hint,
support_data, num_sampled_supports, tol);
}
getShapeSupportSetTplInstantiation(SmallConvex);
// clang-format off
getShapeSupportSetTplInstantiation(SmallConvex)

// ============================================================================
template <int _SupportOptions>
void getShapeSupportSet(const LargeConvex* convex, SupportSet& support_set,
int& hint, ShapeSupportData& support_data,
size_t num_sampled_supports /*unused*/, FCL_REAL tol) {
// clang-format on
getShapeSupportSetLog<_SupportOptions>(
reinterpret_cast<const ConvexBase*>(convex), support_set, hint,
support_data, num_sampled_supports, tol);
Expand Down
18 changes: 18 additions & 0 deletions test/collision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@
#include <fstream>
#include <boost/assign/list_of.hpp>

#include <hpp/fcl/fwd.hh>

HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS

#include <hpp/fcl/collision.h>

HPP_FCL_COMPILER_DIAGNOSTIC_POP

#include <hpp/fcl/BV/BV.h>
#include <hpp/fcl/shape/geometric_shapes.h>
#include <hpp/fcl/narrowphase/narrowphase.h>
Expand Down Expand Up @@ -300,6 +308,9 @@ struct traits<KDOP<N>, Oriented, recursive> : base_traits {
enum { IS_IMPLEMENTED = false };
};

HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS

struct mesh_mesh_run_test {
mesh_mesh_run_test(const std::vector<Transform3f>& _transforms,
const CollisionRequest _request)
Expand All @@ -319,6 +330,8 @@ struct mesh_mesh_run_test {

int indent;

HPP_FCL_COMPILER_DIAGNOSTIC_POP

const char* getindent() {
assert(indent < 9);
static const char* t[] = {"",
Expand Down Expand Up @@ -628,11 +641,16 @@ BOOST_AUTO_TEST_CASE(mesh_mesh) {
<< transforms[i].getQuatRotation().coeffs().format(f));
}

HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS

// Request all contacts and check that all methods give the same result.
mesh_mesh_run_test runner(
transforms, CollisionRequest(CONTACT, (size_t)num_max_contacts));
runner.enable_statistics = true;
boost::mpl::for_each<BVs_t, wrap<boost::mpl::placeholders::_1> >(runner);

HPP_FCL_COMPILER_DIAGNOSTIC_POP
}

BOOST_AUTO_TEST_CASE(mesh_mesh_benchmark) {
Expand Down
7 changes: 7 additions & 0 deletions test/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
#include <fstream>
#include <boost/test/included/unit_test.hpp>

#include <hpp/fcl/fwd.hh>

HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS

#include <hpp/fcl/collision.h>
#include <hpp/fcl/contact_patch.h>
#include <hpp/fcl/distance.h>
Expand Down Expand Up @@ -584,3 +589,5 @@ BOOST_AUTO_TEST_CASE(test_memory_footprint) {
BOOST_CHECK(static_cast<size_t>(m1.memUsage(false)) ==
computeMemoryFootprint(m1));
}

HPP_FCL_COMPILER_DIAGNOSTIC_POP
Loading