From e859a85cebc7fd21eb804effc9f73c61d46e5cea Mon Sep 17 00:00:00 2001 From: Christophe Meynard Date: Fri, 8 Dec 2023 20:10:22 +0100 Subject: [PATCH] MMVII: C++ fixes for g++ and clang++ --- MMVII/src/Matrix/cEigenDenseDecompos.cpp | 8 ++++++++ MMVII/src/Sensors/cMetaDataImages.cpp | 2 +- MMVII/src/Sensors/cSensorCamPC.cpp | 6 +++--- MMVII/src/SysCo/ChSysCoOri.cpp | 2 +- MMVII/src/TieP/cIndexe2Merged.cpp | 2 ++ 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/MMVII/src/Matrix/cEigenDenseDecompos.cpp b/MMVII/src/Matrix/cEigenDenseDecompos.cpp index 5dedbf849b..03ee7073d4 100755 --- a/MMVII/src/Matrix/cEigenDenseDecompos.cpp +++ b/MMVII/src/Matrix/cEigenDenseDecompos.cpp @@ -1,3 +1,8 @@ +// CM: g++ reports "result: may be used uninitialized" with Eigen 3.4.0 +#if defined(__GNUC__) && !defined(__clang__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif #include "MMVII_Tpl_Images.h" #include "MMVII_SysSurR.h" @@ -7,6 +12,9 @@ #include "Eigen/Householder" // HouseholderQR.h" // #include "Eigen/Cholesky" // HouseholderQR.h" +#if defined(__GNUC__) && !defined(__clang__) +# pragma GCC diagnostic pop +#endif using namespace Eigen; namespace MMVII diff --git a/MMVII/src/Sensors/cMetaDataImages.cpp b/MMVII/src/Sensors/cMetaDataImages.cpp index 5f6772113b..af0f69941b 100644 --- a/MMVII/src/Sensors/cMetaDataImages.cpp +++ b/MMVII/src/Sensors/cMetaDataImages.cpp @@ -528,7 +528,7 @@ class cAppli_EditCalcMetaDataImage : public cMMVII_Appli cCollecSpecArg2007 & ArgObl(cCollecSpecArg2007 & anArgObl) override ; cCollecSpecArg2007 & ArgOpt(cCollecSpecArg2007 & anArgOpt) override; - virtual std::vector Samples() const; ///< For help, gives samples of "good" use + std::vector Samples() const override; ///< For help, gives samples of "good" use cPhotogrammetricProject mPhProj; diff --git a/MMVII/src/Sensors/cSensorCamPC.cpp b/MMVII/src/Sensors/cSensorCamPC.cpp index 05c93e8c39..501a570ed2 100644 --- a/MMVII/src/Sensors/cSensorCamPC.cpp +++ b/MMVII/src/Sensors/cSensorCamPC.cpp @@ -274,10 +274,10 @@ cSensorCamPC * cSensorCamPC::PCChangSys(cDataInvertibleMapping & aMap) cPt3dr aJJac ; GetCol(aJJac,aJac,1); cPt3dr aKJac ; GetCol(aKJac,aJac,2); static int aCpt=0; - static tREAL8 aSNorm=0; - tREAL8 aNorm = std::abs(Norm2(aIJac)-Norm2(aJJac)); + //CM: unused: static tREAL8 aSNorm=0; + //CM: unused: tREAL8 aNorm = std::abs(Norm2(aIJac)-Norm2(aJJac)); aCpt++; - aSNorm += aNorm; + //CM: unused: aSNorm += aNorm; // StdOut() << "DNorm=" << aNorm << " Avg=" << aSNorm / aCpt << std::endl; aJac = M3x3FromCol(VUnit(aIJac),VUnit(aJJac),VUnit(aKJac)); } diff --git a/MMVII/src/SysCo/ChSysCoOri.cpp b/MMVII/src/SysCo/ChSysCoOri.cpp index 397740d8c3..73128744a5 100644 --- a/MMVII/src/SysCo/ChSysCoOri.cpp +++ b/MMVII/src/SysCo/ChSysCoOri.cpp @@ -40,7 +40,7 @@ class cAppli_ChSysCoOri : public cMMVII_Appli // Optionall Arg cPt3dr mOrigin; - tREAL8 mZ0; + //CM: unused: tREAL8 mZ0; tREAL8 mEpsDer ; }; diff --git a/MMVII/src/TieP/cIndexe2Merged.cpp b/MMVII/src/TieP/cIndexe2Merged.cpp index 86b7ed3cb3..23f87474a8 100644 --- a/MMVII/src/TieP/cIndexe2Merged.cpp +++ b/MMVII/src/TieP/cIndexe2Merged.cpp @@ -191,6 +191,8 @@ class cReadMTP_Std ); cComputeMergeMulTieP * CompMerge(); + bool WithSensor() const { return mWithSensor;} + private : bool GetNextConfig(); bool mWithIndex;