Skip to content

Commit

Permalink
Use -Wmaybe-uninitialized in odometry header
Browse files Browse the repository at this point in the history
  • Loading branch information
KangarooKoala committed Nov 2, 2024
1 parent 03e1f75 commit f2a7bcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ class SwerveDriveOdometry3d
const Pose2d& initialPose = Pose2d{})
: SwerveDriveOdometry3d::Odometry3d(m_kinematicsImpl, gyroAngle,
modulePositions, initialPose),
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif // defined(__GNUC__) && !defined(__clang__)
m_kinematicsImpl(kinematics) {
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif // defined(__GNUC__) && !defined(__clang__)
wpi::math::MathSharedStore::ReportUsage(
wpi::math::MathUsageId::kOdometry_SwerveDrive, 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,10 @@ class SwerveDriveOdometry3dTest : public ::testing::Test {
};

TEST_F(SwerveDriveOdometry3dTest, Initialize) {
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Werror=maybe-uninitialized"
#endif // defined(__GNUC__) && !defined(__clang__)
SwerveDriveOdometry3d odometry{m_kinematics,
0_rad,
{zero, zero, zero, zero},
frc::Pose2d{1_m, 2_m, 45_deg}};
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif // defined(__GNUC__) && !defined(__clang__)

const frc::Pose2d& pose = odometry.GetPose();

Expand Down

0 comments on commit f2a7bcd

Please sign in to comment.