Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Disable mem-access warnings on aarch64. (ros#506)
Browse files Browse the repository at this point in the history
* Disable mem-access warnings on aarch64.

There is currently a bug in Eigen in Ubuntu 22.04 meaning
that it throws a mem-access warning every time Eigen/PacketMath.h
is used.  There is an upstream fix for it, and we are trying
to get that into Ubuntu 22.04, but that is not guaranteed.
For now, disable the warning only if we are on GCC.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Mar 3, 2022
1 parent 7e70fbd commit 69f78ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tf2_eigen/test/tf2_eigen-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,20 @@
#include <cmath>
#include <memory>

// Version 3.4.0 of Eigen in Ubuntu 22.04 has a bug that causes -Wclass-memaccess warnings on
// aarch64. Upstream Eigen has already fixed this in
// https://gitlab.com/libeigen/eigen/-/merge_requests/645 . The Debian fix for this is in
// 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__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#include <Eigen/Geometry> // NOLINT
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

#include "gtest/gtest.h"

Expand Down
13 changes: 13 additions & 0 deletions tf2_sensor_msgs/include/tf2_sensor_msgs/tf2_sensor_msgs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,21 @@

#include <string>

// Version 3.4.0 of Eigen in Ubuntu 22.04 has a bug that causes -Wclass-memaccess warnings on
// aarch64. Upstream Eigen has already fixed this in
// https://gitlab.com/libeigen/eigen/-/merge_requests/645 . The Debian fix for this is in
// 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__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#include <Eigen/Eigen> // NOLINT
#include <Eigen/Geometry> // NOLINT
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

#include "tf2_ros/buffer_interface.h"

Expand Down

0 comments on commit 69f78ce

Please sign in to comment.