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

Fix GCC 13 warnings #1978

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions examples/TriangulationLOSTExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ int main(int argc, char* argv[]) {

double rank_tol = 1e-9;
std::shared_ptr<Cal3_S2> calib = std::make_shared<Cal3_S2>();
std::chrono::nanoseconds durationDLT;
std::chrono::nanoseconds durationDLTOpt;
std::chrono::nanoseconds durationLOST;
std::chrono::nanoseconds durationDLT{};
std::chrono::nanoseconds durationDLTOpt{};
std::chrono::nanoseconds durationLOST{};

for (int i = 0; i < nrTrials; i++) {
Point2Vector noisyMeasurements =
Expand Down
4 changes: 4 additions & 0 deletions gtsam/basis/tests/testFourier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#include <gtsam/basis/Fourier.h>
#include <gtsam/nonlinear/factorTesting.h>

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic warning "-Wstringop-overread"
#pragma GCC diagnostic warning "-Warray-bounds"
#endif
using namespace std;
using namespace gtsam;

Expand Down
4 changes: 3 additions & 1 deletion gtsam/geometry/BearingRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ struct BearingRange {
TangentVector localCoordinates(const BearingRange& other) const {
typename traits<B>::TangentVector v1 = traits<B>::Local(bearing_, other.bearing_);
typename traits<R>::TangentVector v2 = traits<R>::Local(range_, other.range_);
// Set the first dimB elements to v1, and the next dimR elements to v2
TangentVector v;
v << v1, v2;
v.template head<dimB>() = v1;
v.template tail<dimR>() = v2;
return v;
}

Expand Down
4 changes: 4 additions & 0 deletions gtsam/geometry/FundamentalMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include <gtsam/geometry/FundamentalMatrix.h>
#include <gtsam/geometry/Point2.h>

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably the simplest solution for now, but it is nice that in Eigen 3.4 the SVD implementations have an info() method that can be used to check it and fix the uninitialized warning.

Eigen::JacobiSVD<Matrix3> svd(F, Eigen::ComputeFullU | Eigen::ComputeFullV);
if (svd.info() != Eigen::ComputationInfo::Success) {
    throw std::runtime_error("FundamentalMatrix::FundamentalMatrix unsuccessful svd computation");
}

#endif

namespace gtsam {

//*************************************************************************
Expand Down
3 changes: 3 additions & 0 deletions gtsam/slam/tests/testRotateFactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

#include <vector>

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
using namespace std;
using namespace std::placeholders;
using namespace gtsam;
Expand Down
Loading