Castor compile warnings

Hi Castor developers

For your information, I get the following warnings when compile latest version on a Mac Sierra High 10.13.13.

Hälsningar / Best regards

Michael Ljungberg
Lund university
Sweden

mlj-mac ~/castor> make
Making dependencies for castor-recon.cc ...
Making dependencies for toolkits/castor-datafileConversionEx.cc ...
Making dependencies for toolkits/castor-PetScannerLutEx.cc ...
Making dependencies for toolkits/castor-GATERootToCastor.cc ...
Making dependencies for toolkits/castor-GATEMacToGeom.cc ...
Making dependencies for scanner/vScanner.cc ...
Making dependencies for scanner/sScannerManager.cc ...
Making dependencies for scanner/oMatrix.cc ...
Making dependencies for scanner/iScannerSPECTConv.cc ...
Making dependencies for scanner/iScannerPET.cc ...
Making dependencies for projector/vProjector.cc ...
Making dependencies for projector/oSystemMatrix.cc ...
Making dependencies for projector/oProjectorManager.cc ...
Making dependencies for projector/oProjectionLine.cc ...
Making dependencies for projector/iProjectorTemplate.cc ...
Making dependencies for projector/iProjectorJoseph.cc ...
Making dependencies for projector/iProjectorIncrementalSiddonMulti.cc ...
Making dependencies for projector/iProjectorIncrementalSiddon.cc ...
Making dependencies for projector/iProjectorClassicSiddon.cc ...
Making dependencies for optimizer/vPenalty.cc ...
Making dependencies for optimizer/vOptimizer.cc ...
Making dependencies for optimizer/oOptimizerManager.cc ...
Making dependencies for optimizer/iOptimizerTemplate.cc ...
Making dependencies for optimizer/iOptimizerOriginalAML.cc ...
Making dependencies for optimizer/iOptimizerNEGML.cc ...
Making dependencies for optimizer/iOptimizerMLEM.cc ...
Making dependencies for optimizer/iOptimizerLandweber.cc ...
Making dependencies for management/sRandomNumberGenerator.cc ...
Making dependencies for management/sOutputManager.cc ...
Making dependencies for management/sAddonManager.cc ...
Making dependencies for management/gOptions.cc ...
Making dependencies for management/gDataConversionUtilities.cc ...
Making dependencies for image/vImageProcessingModule.cc ...
Making dependencies for image/vImageConvolver.cc ...
Making dependencies for image/vDeformation.cc ...
Making dependencies for image/oInterfileIO.cc ...
Making dependencies for image/oImageSpace.cc ...
Making dependencies for image/oImageProcessingManager.cc ...
Making dependencies for image/oImageDimensionsAndQuantification.cc ...
Making dependencies for image/oImageConvolverManager.cc ...
Making dependencies for image/oDeformationManager.cc ...
Making dependencies for image/iImageProcessingTemplate.cc ...
Making dependencies for image/iImageConvolverTemplate.cc ...
Making dependencies for image/iImageConvolverStationaryGaussian.cc ...
Making dependencies for image/iDeformationTemplate.cc ...
Making dependencies for dynamic/vDynamicModel.cc ...
Making dependencies for dynamic/oDynamicModelManager.cc ...
Making dependencies for dynamic/iPatlakModel.cc ...
Making dependencies for dynamic/iDynamicModelTemplate.cc ...
Making dependencies for datafile/vEvent.cc ...
Making dependencies for datafile/vDataFile.cc ...
Making dependencies for datafile/oDynamicDataManager.cc ...
Making dependencies for datafile/iEventTransmission.cc ...
Making dependencies for datafile/iEventSPECT.cc ...
Making dependencies for datafile/iEventPET.cc ...
Making dependencies for datafile/iEventNorm.cc ...
Making dependencies for datafile/iEventListSPECT.cc ...
Making dependencies for datafile/iEventListPET.cc ...
Making dependencies for datafile/iEventHistoSPECT.cc ...
Making dependencies for datafile/iEventHistoPET.cc ...
Making dependencies for datafile/iDataFileTransmission.cc ...
Making dependencies for datafile/iDataFileSPECT.cc ...
Making dependencies for datafile/iDataFilePET.cc ...
Making dependencies for analytic_simulator/oComputeProjection.cc ...
Making dependencies for analytic_simulator/oAnalyticProjection.cc ...
Making dependencies for algorithm/oSensitivityGenerator.cc ...
Making dependencies for algorithm/oIterativeAlgorithm.cc ...
Compiling castor-recon.cc ...
Compiling algorithm/oIterativeAlgorithm.cc ...
Compiling algorithm/oSensitivityGenerator.cc ...
Compiling analytic_simulator/oAnalyticProjection.cc ...
Compiling analytic_simulator/oComputeProjection.cc ...
Compiling datafile/iDataFilePET.cc ...
Compiling datafile/iDataFileSPECT.cc ...
Compiling datafile/iDataFileTransmission.cc ...
Compiling datafile/iEventHistoPET.cc ...
Compiling datafile/iEventHistoSPECT.cc ...
Compiling datafile/iEventListPET.cc ...
Compiling datafile/iEventListSPECT.cc ...
Compiling datafile/iEventNorm.cc ...
Compiling datafile/iEventPET.cc ...
Compiling datafile/iEventSPECT.cc ...
Compiling datafile/iEventTransmission.cc ...
Compiling datafile/oDynamicDataManager.cc ...
Compiling datafile/vDataFile.cc ...
Compiling datafile/vEvent.cc ...
Compiling dynamic/iDynamicModelTemplate.cc ...
Compiling dynamic/iPatlakModel.cc ...
Compiling dynamic/oDynamicModelManager.cc ...
Compiling dynamic/vDynamicModel.cc ...
Compiling image/iDeformationTemplate.cc ...
Compiling image/iImageConvolverStationaryGaussian.cc ...
Compiling image/iImageConvolverTemplate.cc ...
Compiling image/iImageProcessingTemplate.cc ...
Compiling image/oDeformationManager.cc ...
Compiling image/oImageConvolverManager.cc ...
Compiling image/oImageDimensionsAndQuantification.cc ...
Compiling image/oImageProcessingManager.cc ...
Compiling image/oImageSpace.cc ...
Compiling image/oInterfileIO.cc ...
src/image/oInterfileIO.cc:3239:24: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
  if(ap_IF->mtx_size[2]<0 && ap_IF->nb_total_imgs>0)
     ~~~~~~~~~~~~~~~~~~^~
1 warning generated.
Compiling image/vDeformation.cc ...
Compiling image/vImageConvolver.cc ...
Compiling image/vImageProcessingModule.cc ...
Compiling management/gDataConversionUtilities.cc ...
Compiling management/gOptions.cc ...
src/management/gOptions.cc:179:19: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
            if(pos<0)
               ~~~^~
src/management/gOptions.cc:198:24: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
            pos = (pos2<0) ? -1 : pos2+1 ;
                   ~~~~^~
src/management/gOptions.cc:307:21: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
              if(pos<0)
                 ~~~^~
src/management/gOptions.cc:325:26: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
              pos = (pos2<0) ? -1 : pos2+1 ;
                     ~~~~^~
src/management/gOptions.cc:435:21: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
              if(pos<0)
                 ~~~^~
src/management/gOptions.cc:453:26: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
              pos = (pos2<0) ? -1 : pos2+1 ;
                     ~~~~^~
src/management/gOptions.cc:569:21: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
              if(pos<0)
                 ~~~^~
src/management/gOptions.cc:587:26: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
              pos = (pos2<0) ? -1 : pos2+1 ;
                     ~~~~^~
src/management/gOptions.cc:711:23: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
                if(pos<0)
                   ~~~^~
src/management/gOptions.cc:729:28: warning: comparison of unsigned expression <
      0 is always false [-Wtautological-compare]
                pos = (pos2<0) ? -1 : pos2+1 ;
                       ~~~~^~
10 warnings generated.
Compiling management/sAddonManager.cc ...
Compiling management/sOutputManager.cc ...
Compiling management/sRandomNumberGenerator.cc ...
Compiling optimizer/iOptimizerLandweber.cc ...
Compiling optimizer/iOptimizerMLEM.cc ...
Compiling optimizer/iOptimizerNEGML.cc ...
Compiling optimizer/iOptimizerOriginalAML.cc ...
Compiling optimizer/iOptimizerTemplate.cc ...
Compiling optimizer/oOptimizerManager.cc ...
Compiling optimizer/vOptimizer.cc ...
Compiling optimizer/vPenalty.cc ...
Compiling projector/iProjectorClassicSiddon.cc ...
Compiling projector/iProjectorIncrementalSiddon.cc ...
Compiling projector/iProjectorIncrementalSiddonMulti.cc ...
Compiling projector/iProjectorJoseph.cc ...
Compiling projector/iProjectorTemplate.cc ...
Compiling projector/oProjectionLine.cc ...
Compiling projector/oProjectorManager.cc ...
Compiling projector/oSystemMatrix.cc ...
In file included from src/projector/oSystemMatrix.cc:41:
include/projector/oSystemMatrix.hh:124:15: warning: private field 'mp_Scanner'
      is not used [-Wunused-private-field]
    vScanner* mp_Scanner; /*!< The pointer t...
              ^
1 warning generated.
Compiling projector/vProjector.cc ...
src/projector/vProjector.cc:250:32: warning: logical not is only applied to the
      left hand side of this comparison [-Wlogical-not-parentheses]
  if (m_applyTOF!=USE_NOTOF && !m_TOFnbSigmas>0.)
                               ^ ~
src/projector/vProjector.cc:250:32: note: add parentheses after the '!' to
      evaluate the comparison first
  if (m_applyTOF!=USE_NOTOF && !m_TOFnbSigmas>0.)
                               ^
                                ( )
src/projector/vProjector.cc:250:32: note: add parentheses around left hand side
      expression to silence this warning
  if (m_applyTOF!=USE_NOTOF && !m_TOFnbSigmas>0.)
                               ^
                               ( )
1 warning generated.
Compiling scanner/iScannerPET.cc ...
Compiling scanner/iScannerSPECTConv.cc ...
Compiling scanner/oMatrix.cc ...
Compiling scanner/sScannerManager.cc ...
Compiling scanner/vScanner.cc ...
Compiling toolkits/castor-GATEMacToGeom.cc ...
Compiling toolkits/castor-GATERootToCastor.cc ...
Compiling toolkits/castor-PetScannerLutEx.cc ...
toolkits/castor-PetScannerLutEx.cc:508:5: warning: 'delete' applied to a pointer
      that was allocated with 'new[]'; did you mean 'delete[]'?
      [-Wmismatched-new-delete]
    delete crystal_positionX;
    ^
          []
toolkits/castor-PetScannerLutEx.cc:308:35: note: allocated with 'new[]' here
    FLTNBLUT* crystal_positionX = new FLTNBLUT[ nb_crystals_lyr[lyr] ];
                                  ^
toolkits/castor-PetScannerLutEx.cc:509:5: warning: 'delete' applied to a pointer
      that was allocated with 'new[]'; did you mean 'delete[]'?
      [-Wmismatched-new-delete]
    delete crystal_positionY;
    ^
          []
toolkits/castor-PetScannerLutEx.cc:309:35: note: allocated with 'new[]' here
    FLTNBLUT* crystal_positionY = new FLTNBLUT[ nb_crystals_lyr[lyr] ];
                                  ^
toolkits/castor-PetScannerLutEx.cc:510:5: warning: 'delete' applied to a pointer
      that was allocated with 'new[]'; did you mean 'delete[]'?
      [-Wmismatched-new-delete]
    delete crystal_positionZ;
    ^
          []
toolkits/castor-PetScannerLutEx.cc:310:35: note: allocated with 'new[]' here
    FLTNBLUT* crystal_positionZ = new FLTNBLUT[ nb_crystals_lyr[lyr] ];
                                  ^
toolkits/castor-PetScannerLutEx.cc:511:5: warning: 'delete' applied to a pointer
      that was allocated with 'new[]'; did you mean 'delete[]'?
      [-Wmismatched-new-delete]
    delete crystal_orientationX;
    ^
          []
toolkits/castor-PetScannerLutEx.cc:311:38: note: allocated with 'new[]' here
    FLTNBLUT* crystal_orientationX = new FLTNBLUT[ nb_crystals_lyr[lyr] ];
                                     ^
toolkits/castor-PetScannerLutEx.cc:512:5: warning: 'delete' applied to a pointer
      that was allocated with 'new[]'; did you mean 'delete[]'?
      [-Wmismatched-new-delete]
    delete crystal_orientationY;
    ^
          []
toolkits/castor-PetScannerLutEx.cc:312:38: note: allocated with 'new[]' here
    FLTNBLUT* crystal_orientationY = new FLTNBLUT[ nb_crystals_lyr[lyr] ];
                                     ^
toolkits/castor-PetScannerLutEx.cc:513:5: warning: 'delete' applied to a pointer
      that was allocated with 'new[]'; did you mean 'delete[]'?
      [-Wmismatched-new-delete]
    delete crystal_orientationZ;
    ^
          []
toolkits/castor-PetScannerLutEx.cc:313:38: note: allocated with 'new[]' here
    FLTNBLUT* crystal_orientationZ = new FLTNBLUT[ nb_crystals_lyr[lyr] ];
                                     ^
6 warnings generated.
Compiling toolkits/castor-datafileConversionEx.cc ...
toolkits/castor-datafileConversionEx.cc:737:23: warning: variable 'rSectorID1'
      is uninitialized when used here [-Wuninitialized]
                    + rSectorID1*nb_crystals_trs
                      ^~~~~~~~~~
toolkits/castor-datafileConversionEx.cc:667:21: note: initialize the variable
      'rSectorID1' to silence this warning
  int32_t rSectorID1, rSectorID2;
                    ^
                     = 0
toolkits/castor-datafileConversionEx.cc:721:44: warning: variable 'crystalID1'
      is uninitialized when used here [-Wuninitialized]
    uint32_t crystals_trs_id1 = (uint32_t)(crystalID1/nb_crystals_trs);
                                           ^~~~~~~~~~
toolkits/castor-datafileConversionEx.cc:669:21: note: initialize the variable
      'crystalID1' to silence this warning
  int32_t crystalID1, crystalID2;
                    ^
                     = 0
toolkits/castor-datafileConversionEx.cc:741:23: warning: variable 'rSectorID2'
      is uninitialized when used here [-Wuninitialized]
                    + rSectorID2*nb_crystals_trs
                      ^~~~~~~~~~
toolkits/castor-datafileConversionEx.cc:667:33: note: initialize the variable
      'rSectorID2' to silence this warning
  int32_t rSectorID1, rSectorID2;
                                ^
                                 = 0
toolkits/castor-datafileConversionEx.cc:726:44: warning: variable 'crystalID2'
      is uninitialized when used here [-Wuninitialized]
    uint32_t crystals_trs_id2 = (uint32_t)(crystalID2/nb_crystals_trs);
                                           ^~~~~~~~~~
toolkits/castor-datafileConversionEx.cc:669:33: note: initialize the variable
      'crystalID2' to silence this warning
  int32_t crystalID1, crystalID2;
                                ^
                                 = 0
toolkits/castor-datafileConversionEx.cc:723:24: warning: variable 'moduleID1' is
      uninitialized when used here [-Wuninitialized]
    uint32_t ringID1 = moduleID1*nb_crystals_axl
                       ^~~~~~~~~
toolkits/castor-datafileConversionEx.cc:668:20: note: initialize the variable
      'moduleID1' to silence this warning
  int32_t moduleID1, moduleID2;
                   ^
                    = 0
toolkits/castor-datafileConversionEx.cc:728:24: warning: variable 'moduleID2' is
      uninitialized when used here [-Wuninitialized]
    uint32_t ringID2 = moduleID2*nb_crystals_axl
                       ^~~~~~~~~
toolkits/castor-datafileConversionEx.cc:668:31: note: initialize the variable
      'moduleID2' to silence this warning
  int32_t moduleID1, moduleID2;
                              ^
                               = 0
6 warnings generated.
Linking castor-recon ...
Linking castor-GATEMacToGeom ...
Linking castor-GATERootToCastor ...
Linking castor-PetScannerLutEx ...
Linking castor-datafileConversionEx ...
All executables are in bin

Hello Michael,

Thank you very much for the feedback, these warnings will be addressed in the next version of the code.

Kind regards,

Thibaut