Skip to content

Commit

Permalink
Fix clang build warnings. (#628)
Browse files Browse the repository at this point in the history
For Ubuntu 22.04, we disabled some warnings with GCC
specifically for arm64.  However, those flags are not
supported on clang, and further clang defines __GNU__ when
compiling.  Add in an additional check for being on clang
so we avoid a clang warning.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
  • Loading branch information
clalancette authored Sep 19, 2023
1 parent 8706e81 commit 2311918
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tf2_eigen/test/tf2_eigen-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
// https://salsa.debian.org/science-team/eigen3/-/merge_requests/1 .
// However, it is not clear that that fix is going to make it into Ubuntu 22.04 before it
// freezes, so disable the warning here.
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#include <Eigen/Geometry> // NOLINT
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

Expand Down
4 changes: 2 additions & 2 deletions tf2_eigen_kdl/include/tf2_eigen_kdl/tf2_eigen_kdl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
// https://salsa.debian.org/science-team/eigen3/-/merge_requests/1 .
// However, it is not clear that that fix is going to make it into Ubuntu 22.04 before it
// freezes, so disable the warning here.
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#include <Eigen/Core>
#include <Eigen/Geometry>
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

Expand Down
4 changes: 2 additions & 2 deletions tf2_sensor_msgs/include/tf2_sensor_msgs/tf2_sensor_msgs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
// https://salsa.debian.org/science-team/eigen3/-/merge_requests/1 .
// However, it is not clear that that fix is going to make it into Ubuntu 22.04 before it
// freezes, so disable the warning here.
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#include <Eigen/Eigen> // NOLINT
#include <Eigen/Geometry> // NOLINT
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

Expand Down

0 comments on commit 2311918

Please sign in to comment.