-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 clang warnings alignment 80X (Backport of #14875) #14876
Fix clang warnings alignment 80X (Backport of #14875) #14876
Conversation
Fixed warnings: ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h:245:13: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value] if (abs(ObsMove) > maxMoveCut_) { ^ ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h:245:13: note: use function 'std::abs' instead if (abs(ObsMove) > maxMoveCut_) { ^~~ std::abs ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h:253:20: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value] } else if (abs(ObsMove) > Cutoffs[alignableIndex]) { ^ ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h:253:20: note: use function 'std::abs' instead } else if (abs(ObsMove) > Cutoffs[alignableIndex]) { ^~~ std::abs ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h:256:15: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value] if (abs(ObsErr) > maxErrorCut_) { ^ ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h:256:15: note: use function 'std::abs' instead if (abs(ObsErr) > maxErrorCut_) { ^~~ std::abs ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h:264:17: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value] if (abs(ObsMove/ObsErr) > sigCut_) { ^ ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeFileReader.h:264:17: note: use function 'std::abs' instead if (abs(ObsMove/ObsErr) > sigCut_) { ^~~ std::abs
Required 'Alignment/MillePedeAlignmentAlgorithm' to become a shared library instead of a plugin.
Fixed warning: ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.cc:21:5: warning: binding reference member 'mpReaderConfig_' to a temporary value [-Wdangling-field] config.getParameter<edm::ParameterSet>("MillePedeFileReader") ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/plugins/MillePedeDQMModule.h:71:30: note: reference member declared here const edm::ParameterSet& mpReaderConfig_; ^
…nt'. Fixed warnings: ${CMSSW_BASE}/src/Alignment/TwoBodyDecay/interface/TwoBodyDecayVirtualMeasurement.h:28:21: warning: binding reference member 'thePrimaryMass' to stack allocated parameter 'primaryMass' [-Wdangling-field] thePrimaryMass( primaryMass ), ^~~~~~~~~~~ ${CMSSW_BASE}/src/Alignment/TwoBodyDecay/interface/TwoBodyDecayVirtualMeasurement.h:55:18: note: reference member declared here const double & thePrimaryMass; ^ ${CMSSW_BASE}/src/Alignment/TwoBodyDecay/interface/TwoBodyDecayVirtualMeasurement.h:29:22: warning: binding reference member 'thePrimaryWidth' to stack allocated parameter 'primaryWidth' [-Wdangling-field] thePrimaryWidth( primaryWidth ), ^~~~~~~~~~~~ ${CMSSW_BASE}/src/Alignment/TwoBodyDecay/interface/TwoBodyDecayVirtualMeasurement.h:56:18: note: reference member declared here const double & thePrimaryWidth; ^ ${CMSSW_BASE}/src/Alignment/TwoBodyDecay/interface/TwoBodyDecayVirtualMeasurement.h:30:23: warning: binding reference member 'theSecondaryMass' to stack allocated parameter 'secondaryMass' [-Wdangling-field] theSecondaryMass( secondaryMass ), ^~~~~~~~~~~~~ ${CMSSW_BASE}/src/Alignment/TwoBodyDecay/interface/TwoBodyDecayVirtualMeasurement.h:57:18: note: reference member declared here const double & theSecondaryMass; ^
Fixed warnings: /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_1_0_pre6/src/CondFormats/Alignment/interface/SurveyErrors.h:19:1: warning: 'SurveyErrors' defined as a struct here but previously declared as a class [-Wmismatched-tags] struct SurveyErrors ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentProducer/plugins/AlignmentProducer.h:50:1: note: did you mean struct here? class SurveyErrors; ^~~~~ struct ${CMSSW_BASE}/src/Alignment/SurveyAnalysis/plugins/SurveyDBUploader.h:25:1: warning: class 'SurveyErrors' was previously declared as a struct [-Wmismatched-tags] class SurveyErrors; ^ /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_1_0_pre6/src/CondFormats/Alignment/interface/SurveyErrors.h:19:8: note: previous use is here struct SurveyErrors ^ ${CMSSW_BASE}/src/Alignment/SurveyAnalysis/plugins/SurveyDBUploader.h:25:1: note: did you mean struct here? class SurveyErrors; ^~~~~ struct
…ages. Fixed warnings: ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeAlignmentAlgorithm.h:65:16: warning: 'initialize' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual void initialize(const edm::EventSetup &setup, ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h:118:16: note: overridden virtual function is here virtual void initialize( const edm::EventSetup& setup, ^ In file included from ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/src/MillePedeAlignmentAlgorithm.cc:11: ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeAlignmentAlgorithm.h:72:16: warning: 'addCalibrations' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual bool addCalibrations(const std::vector<IntegratedCalibrationBase*> &iCals); ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h:129:16: note: overridden virtual function is here virtual bool addCalibrations(const Calibrations&) { return false; } ^ In file included from ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/src/MillePedeAlignmentAlgorithm.cc:11: ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeAlignmentAlgorithm.h:75:16: warning: 'terminate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual void terminate(const edm::EventSetup& iSetup); ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h:141:16: note: overridden virtual function is here virtual void terminate(const edm::EventSetup& iSetup) = 0; ^ In file included from ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/src/MillePedeAlignmentAlgorithm.cc:11: ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeAlignmentAlgorithm.h:77:16: warning: 'terminate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual void terminate(); ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h:143:16: note: overridden virtual function is here virtual void terminate() {} ^ In file included from ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/src/MillePedeAlignmentAlgorithm.cc:11: ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeAlignmentAlgorithm.h:82:16: warning: 'run' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual void run(const edm::EventSetup &setup, const EventInfo &eventInfo); ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h:146:16: note: overridden virtual function is here virtual void run( const edm::EventSetup &setup, const EventInfo &eventInfo) = 0; ^ In file included from ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/src/MillePedeAlignmentAlgorithm.cc:11: ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeAlignmentAlgorithm.h:91:16: warning: 'endRun' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup); ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h:152:16: note: overridden virtual function is here virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup) {}; ^ In file included from ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/src/MillePedeAlignmentAlgorithm.cc:11: ${CMSSW_BASE}/src/Alignment/MillePedeAlignmentAlgorithm/interface/MillePedeAlignmentAlgorithm.h:99:16: warning: 'setParametersForRunRange' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] virtual bool setParametersForRunRange(const RunRange &runrange); ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h:162:16: note: overridden virtual function is here virtual bool setParametersForRunRange(const RunRange& rr) { return false; }; ^
…tory'. Fixed warning: ${CMSSW_BASE}/src/Alignment/ReferenceTrajectories/interface/DualBzeroReferenceTrajectory.h:58:32: warning: 'DualBzeroReferenceTrajectory::construct' hides overloaded virtual functions [-Woverloaded-virtual] virtual ReferenceTrajectory* construct(const TrajectoryStateOnSurface &referenceTsos, ^ ${CMSSW_BASE}/src/Alignment/ReferenceTrajectories/interface/DualReferenceTrajectory.h:60:16: note: hidden overloaded virtual function 'DualReferenceTrajectory::construct' declared here: different number of parameters (5 vs 8) virtual bool construct(const TrajectoryStateOnSurface &referenceTsos, ^ ${CMSSW_BASE}/src/Alignment/ReferenceTrajectories/interface/DualReferenceTrajectory.h:66:32: note: hidden overloaded virtual function 'DualReferenceTrajectory::construct' declared here: different number of parameters (5 vs 8) virtual ReferenceTrajectory* construct(const TrajectoryStateOnSurface &referenceTsos, ^
Command used for the conversion: 'dos2unix Alignment/CocoaModel/src/LightRay.cc' Afterwards, trailing whitespace has been removed.
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaModel/src/LightRay.cc:203:7: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if( fabs(sinangp) > 1. ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/LightRay.cc:203:7: note: use function 'std::abs' instead if( fabs(sinangp) > 1. ) { ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/LightRay.cc:219:12: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] signN /= fabs(signN); ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/LightRay.cc:219:12: note: use function 'std::abs' instead signN /= fabs(signN); ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/LightRay.cc:221:12: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] sign1 /= fabs(sign1); ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/LightRay.cc:221:12: note: use function 'std::abs' instead sign1 /= fabs(sign1); ^~~~ std::abs 3 warnings generated.
… DOS to Unix format. Command used for the conversion: 'dos2unix Alignment/CocoaModel/src/DeviationsFromFileSensor2D.cc' Afterwards, trailing whitespace has been removed.
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaModel/src/DeviationsFromFileSensor2D.cc:61:11: warning: absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if( fabs( dev->posX() - oldposX ) > fabs( dev->posY() - oldposY ) ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/DeviationsFromFileSensor2D.cc:61:11: note: use function 'std::abs' instead if( fabs( dev->posX() - oldposX ) > fabs( dev->posY() - oldposY ) ) { ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/DeviationsFromFileSensor2D.cc:61:44: warning: absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if( fabs( dev->posX() - oldposX ) > fabs( dev->posY() - oldposY ) ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/DeviationsFromFileSensor2D.cc:61:44: note: use function 'std::abs' instead if( fabs( dev->posX() - oldposX ) > fabs( dev->posY() - oldposY ) ) { ^~~~ std::abs
Command used for the conversion: 'dos2unix Alignment/CocoaModel/src/ALILine.cc' Afterwards, trailing whitespace has been removed.
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:107:7: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if(fabs(fact) > 1e8 || fabs(old_fact_denominator) < 1.e-10) ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:107:7: note: use function 'std::abs' instead if(fabs(fact) > 1e8 || fabs(old_fact_denominator) < 1.e-10) ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:107:27: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if(fabs(fact) > 1e8 || fabs(old_fact_denominator) < 1.e-10) ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:107:27: note: use function 'std::abs' instead if(fabs(fact) > 1e8 || fabs(old_fact_denominator) < 1.e-10) ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:114:35: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if(ALIUtils::debug >= 2 && fabs(old_fact_denominator) < 1.e-10) std::cout << " ** Problem: old_fact_denominator -> " << old_fact_denominator << std::endl; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:114:35: note: use function 'std::abs' instead if(ALIUtils::debug >= 2 && fabs(old_fact_denominator) < 1.e-10) std::cout << " ** Problem: old_fact_denominator -> " << old_fact_denominator << std::endl; ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:116:35: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if(ALIUtils::debug >= 2 && fabs(fact) > 1e8) std::cout << " ** Problem: fact -> " << fact << std::endl; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:116:35: note: use function 'std::abs' instead if(ALIUtils::debug >= 2 && fabs(fact) > 1e8) std::cout << " ** Problem: fact -> " << fact << std::endl; ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:135:33: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if(ALIUtils::debug >= 2 && fabs(old_fact_denominator2) < 1.e-10) std::cout << " ** Problem: old_fact_denominator2 -> " << old_fact_denominator2 << std::endl; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALILine.cc:135:33: note: use function 'std::abs' instead if(ALIUtils::debug >= 2 && fabs(old_fact_denominator2) < 1.e-10) std::cout << " ** Problem: old_fact_denominator2 -> " << old_fact_denominator2 << std::endl; ^~~~ std::abs
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaToDDL/src/CocoaUnitsTable.cc:389:39: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble value = std::max(std::max(fabs(a.Value[0]),fabs(a.Value[1])), ^ ${CMSSW_BASE}/src/Alignment/CocoaToDDL/src/CocoaUnitsTable.cc:389:39: note: use function 'std::abs' instead ALIdouble value = std::max(std::max(fabs(a.Value[0]),fabs(a.Value[1])), ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaToDDL/src/CocoaUnitsTable.cc:389:56: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble value = std::max(std::max(fabs(a.Value[0]),fabs(a.Value[1])), ^ ${CMSSW_BASE}/src/Alignment/CocoaToDDL/src/CocoaUnitsTable.cc:389:56: note: use function 'std::abs' instead ALIdouble value = std::max(std::max(fabs(a.Value[0]),fabs(a.Value[1])), ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaToDDL/src/CocoaUnitsTable.cc:390:31: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] fabs(a.Value[2])); ^ ${CMSSW_BASE}/src/Alignment/CocoaToDDL/src/CocoaUnitsTable.cc:390:31: note: use function 'std::abs' instead fabs(a.Value[2])); ^~~~ std::abs
…format. Command used for the conversion: 'dos2unix Alignment/CocoaModel/src/ALIUnitsTable.cc' Afterwards, trailing whitespace has been removed.
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALIUnitsTable.cc:370:39: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble value = std::max(std::max(fabs(a.Value[0]),fabs(a.Value[1])), ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALIUnitsTable.cc:370:39: note: use function 'std::abs' instead ALIdouble value = std::max(std::max(fabs(a.Value[0]),fabs(a.Value[1])), ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALIUnitsTable.cc:370:56: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble value = std::max(std::max(fabs(a.Value[0]),fabs(a.Value[1])), ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALIUnitsTable.cc:370:56: note: use function 'std::abs' instead ALIdouble value = std::max(std::max(fabs(a.Value[0]),fabs(a.Value[1])), ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALIUnitsTable.cc:371:31: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] fabs(a.Value[2])); ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/ALIUnitsTable.cc:371:31: note: use function 'std::abs' instead fabs(a.Value[2])); ^~~~ std::abs
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:964:33: warning: absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble rel_fit_quality = fabs(thePreviousIterationFitQuality - fit_quality)/fit_quality; ^ ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:964:33: note: use function 'std::abs' instead ALIdouble rel_fit_quality = fabs(thePreviousIterationFitQuality - fit_quality)/fit_quality; ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1399:11: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if (fabs(corrf) >= minCorrel ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1399:11: note: use function 'std::abs' instead if (fabs(corrf) >= minCorrel ) { ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1562:13: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if( fabs((*AMatrix)(ii,nCol)) > ALI_DBL_MIN ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1562:13: note: use function 'std::abs' instead if( fabs((*AMatrix)(ii,nCol)) > ALI_DBL_MIN ) { ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1594:17: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if( fabs((*AMatrix)(ii,fitpos1)) < derivPrec ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1594:17: note: use function 'std::abs' instead if( fabs((*AMatrix)(ii,fitpos1)) < derivPrec ) { ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1595:12: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if( fabs((*AMatrix)(ii,fitpos2)) > derivPrec ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1595:12: note: use function 'std::abs' instead if( fabs((*AMatrix)(ii,fitpos2)) > derivPrec ) { ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1629:9: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if( fabs((*AMatrix)(measNo,ii)) > biggest ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1629:9: note: use function 'std::abs' instead if( fabs((*AMatrix)(measNo,ii)) > biggest ) { ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1630:17: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] biggest = fabs((*AMatrix)(measNo,ii)); ^ ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1630:17: note: use function 'std::abs' instead biggest = fabs((*AMatrix)(measNo,ii)); ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1644:11: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if( fabs((*AMatrix)(jj,ii)) > ALI_DBL_MIN && fabs(div - (*AMatrix)(jj,ii)/(*AMatrix)(jj,biggestColumn) ) > ALI_DBL_MIN ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1644:11: note: use function 'std::abs' instead if( fabs((*AMatrix)(jj,ii)) > ALI_DBL_MIN && fabs(div - (*AMatrix)(jj,ii)/(*AMatrix)(jj,biggestColumn) ) > ALI_DBL_MIN ) { ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1644:53: warning: absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] if( fabs((*AMatrix)(jj,ii)) > ALI_DBL_MIN && fabs(div - (*AMatrix)(jj,ii)/(*AMatrix)(jj,biggestColumn) ) > ALI_DBL_MIN ) { ^ ${CMSSW_BASE}/src/Alignment/CocoaFit/src/Fit.cc:1644:53: note: use function 'std::abs' instead if( fabs((*AMatrix)(jj,ii)) > ALI_DBL_MIN && fabs(div - (*AMatrix)(jj,ii)/(*AMatrix)(jj,biggestColumn) ) > ALI_DBL_MIN ) { ^~~~ std::abs
…o Unix format. Command used for the conversion: 'dos2unix Alignment/CocoaModel/src/MeasurementDiffEntry.cc' Afterwards, trailing whitespace has been removed.
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaModel/src/MeasurementDiffEntry.cc:90:49: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble detD = 1000*valueSimulated(0); if(fabs(detD) <= 1.e-9 ) detD = 0.; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/MeasurementDiffEntry.cc:90:49: note: use function 'std::abs' instead ALIdouble detD = 1000*valueSimulated(0); if(fabs(detD) <= 1.e-9 ) detD = 0.; ^~~~ std::abs
…tionsStore'. Minimal fix for these warnings. Better approach would be a slight redesign with a common base class 'AlignmentCorrelationsStore' from which the former 'AlignmentCorrelationsStore' (renamed to 'AlignmentBasicCorrelationsStore' or similar) and 'AlignmentExtendedCorrelationsStore' can derive. The new abstract class should then have only pure virtual public functions. Fixed warnings: ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentExtendedCorrelationsStore.h:59:16: warning: 'AlignmentExtendedCorrelationsStore::fillCorrelationsTable' hides overloaded virtual function [-Woverloaded-virtual] virtual void fillCorrelationsTable( Alignable* ap1, Alignable* ap2, ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentCorrelationsStore.h:52:16: note: hidden overloaded virtual function 'AlignmentCorrelationsStore::fillCorrelationsTable' declared here: type mismatch at 3rd parameter ('CorrelationsTable *' (aka 'map<Alignable *, CLHEP::HepMatrix> *') vs 'ExtendedCorrelationsTable *' (aka 'map<Alignable *, AlignmentExtendedCorrelationsEntry> *')) virtual void fillCorrelationsTable( Alignable* ap1, Alignable* ap2, CorrelationsTable* table, ^ In file included from ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/src/AlignmentParameterStore.cc:22: ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentExtendedCorrelationsStore.h:64:16: warning: 'AlignmentExtendedCorrelationsStore::fillCovariance' hides overloaded virtual function [-Woverloaded-virtual] virtual void fillCovariance( Alignable* ap1, Alignable* ap2, const ExtendedCorrelationsEntry& entry, ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentCorrelationsStore.h:55:16: note: hidden overloaded virtual function 'AlignmentCorrelationsStore::fillCovariance' declared here: type mismatch at 3rd parameter ('const AlgebraicMatrix &' (aka 'const CLHEP::HepMatrix &') vs 'const ExtendedCorrelationsEntry &' (aka 'const AlignmentExtendedCorrelationsEntry &')) virtual void fillCovariance( Alignable* ap1, Alignable* ap2, const AlgebraicMatrix& entry, ^ In file included from ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/src/AlignmentParameterStore.cc:22: ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentExtendedCorrelationsStore.h:67:16: warning: 'AlignmentExtendedCorrelationsStore::fillCovarianceT' hides overloaded virtual function [-Woverloaded-virtual] virtual void fillCovarianceT( Alignable* ap1, Alignable* ap2, const ExtendedCorrelationsEntry& entry, ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentCorrelationsStore.h:58:16: note: hidden overloaded virtual function 'AlignmentCorrelationsStore::fillCovarianceT' declared here: type mismatch at 3rd parameter ('const AlgebraicMatrix &' (aka 'const CLHEP::HepMatrix &') vs 'const ExtendedCorrelationsEntry &' (aka 'const AlignmentExtendedCorrelationsEntry &')) virtual void fillCovarianceT( Alignable* ap1, Alignable* ap2, const AlgebraicMatrix& entry, ^ In file included from ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/src/AlignmentParameterStore.cc:22: ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentExtendedCorrelationsStore.h:70:16: warning: 'AlignmentExtendedCorrelationsStore::readFromCovariance' hides overloaded virtual function [-Woverloaded-virtual] virtual void readFromCovariance( Alignable* ap1, Alignable* ap2, ExtendedCorrelationsEntry& entry, ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentCorrelationsStore.h:61:16: note: hidden overloaded virtual function 'AlignmentCorrelationsStore::readFromCovariance' declared here: type mismatch at 3rd parameter ('AlgebraicMatrix &' (aka 'CLHEP::HepMatrix &') vs 'ExtendedCorrelationsEntry &' (aka 'AlignmentExtendedCorrelationsEntry &')) virtual void readFromCovariance( Alignable* ap1, Alignable* ap2, AlgebraicMatrix& entry, ^ In file included from ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/src/AlignmentParameterStore.cc:22: ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentExtendedCorrelationsStore.h:73:16: warning: 'AlignmentExtendedCorrelationsStore::readFromCovarianceT' hides overloaded virtual function [-Woverloaded-virtual] virtual void readFromCovarianceT( Alignable* ap1, Alignable* ap2, ExtendedCorrelationsEntry& entry, ^ ${CMSSW_BASE}/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentCorrelationsStore.h:64:16: note: hidden overloaded virtual function 'AlignmentCorrelationsStore::readFromCovarianceT' declared here: type mismatch at 3rd parameter ('AlgebraicMatrix &' (aka 'CLHEP::HepMatrix &') vs 'ExtendedCorrelationsEntry &' (aka 'AlignmentExtendedCorrelationsEntry &')) virtual void readFromCovarianceT( Alignable* ap1, Alignable* ap2, AlgebraicMatrix& entry, ^ 5 warnings generated.
…ormat. Commands used for the conversion: dos2unix Alignment/CocoaModel/interface/OptOUserDefined.h dos2unix Alignment/CocoaModel/src/OptOUserDefined.cc Afterwards, trailing whitespace has been removed.
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaModel/interface/OptOUserDefined.h:33:16: warning: 'OptOUserDefined::userDefinedBehaviour' hides overloaded virtual function [-Woverloaded-virtual] virtual void userDefinedBehaviour( LightRay& lightray, Measurement& meas, ALIstring& behav); ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/interface/OpticalObject.h:177:16: note: hidden overloaded virtual function 'OpticalObject::userDefinedBehaviour' declared here: type mismatch at 3rd parameter ('const ALIstring &' (aka 'const basic_string<char> &') vs 'ALIstring &' (aka 'basic_string<char> &')) virtual void userDefinedBehaviour( LightRay& lightray, Measurement& meas, const ALIstring& behav); ^
…x format. Command used for the conversion: 'dos2unix Alignment/CocoaModel/*/OptOCameraDetector.*' Afterwards, trailing whitespace has been removed.
Fixed warning: ${CMSSW_BASE}/src/Alignment/CocoaModel/interface/OptOCameraDetector.h:29:16: warning: 'OptOCameraDetector::participateInMeasurement' hides overloaded virtual function [-Woverloaded-virtual] virtual void participateInMeasurement( LightRay& lightray, Measurement* meas, const ALIstring& behav ); ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/interface/OpticalObject.h:161:16: note: hidden overloaded virtual function 'OpticalObject::participateInMeasurement' declared here: type mismatch at 2nd parameter ('Measurement &' vs 'Measurement *') virtual void participateInMeasurement( LightRay& lightray, Measurement& meas, const ALIstring& behav ); ^
…rmat. Command used for the conversion: 'dos2unix Alignment/CocoaModel/src/Measurement.cc' Afterwards, trailing whitespace has been removed.
Fixed warning: ${CMSSW_BASE}/src/Alignment/CocoaModel/src/Measurement.cc:536:19: warning: absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] sumderiv += fabs( theValueSimulated[ii] - theValueSimulated_orig[ii] ); ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/Measurement.cc:536:19: note: use function 'std::abs' instead sumderiv += fabs( theValueSimulated[ii] - theValueSimulated_orig[ii] ); ^~~~ std::abs
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOSensor2D.cc:86:55: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble detH = 1000*meas.valueSimulated(0); if(fabs(detH) <= 1.e-9 ) detH = 0.; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOSensor2D.cc:86:55: note: use function 'std::abs' instead ALIdouble detH = 1000*meas.valueSimulated(0); if(fabs(detH) <= 1.e-9 ) detH = 0.; ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOSensor2D.cc:87:55: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble detV = 1000*meas.valueSimulated(1); if(fabs(detV) <= 1.e-9 ) detV = 0.; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOSensor2D.cc:87:55: note: use function 'std::abs' instead ALIdouble detV = 1000*meas.valueSimulated(1); if(fabs(detV) <= 1.e-9 ) detV = 0.; ^~~~ std::abs
Command used for the conversion: 'dos2unix Alignment/CocoaModel/src/OptOCOPS.cc' Afterwards, trailing whitespace has been removed.
Fixed warnings: ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:269:18: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] << " " << fabs( measv[ii][0] ) << " " << fabs( measv[ii][1] ) << " edm::isNotFinite() = " << ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:269:18: note: use function 'std::abs' instead << " " << fabs( measv[ii][0] ) << " " << fabs( measv[ii][1] ) << " edm::isNotFinite() = " << ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:269:50: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] << " " << fabs( measv[ii][0] ) << " " << fabs( measv[ii][1] ) << " edm::isNotFinite() = " << ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:269:50: note: use function 'std::abs' instead << " " << fabs( measv[ii][0] ) << " " << fabs( measv[ii][1] ) << " edm::isNotFinite() = " << ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:286:19: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] laserLine = fabs( measv[ii][0] ) < fabs( measv[ii][1] ); ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:286:19: note: use function 'std::abs' instead laserLine = fabs( measv[ii][0] ) < fabs( measv[ii][1] ); ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:286:43: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] laserLine = fabs( measv[ii][0] ) < fabs( measv[ii][1] ); ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:286:43: note: use function 'std::abs' instead laserLine = fabs( measv[ii][0] ) < fabs( measv[ii][1] ); ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:323:55: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble detU = 1000*meas.valueSimulated(0); if(fabs(detU) <= 1.e-9 ) detU = 0.; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:323:55: note: use function 'std::abs' instead ALIdouble detU = 1000*meas.valueSimulated(0); if(fabs(detU) <= 1.e-9 ) detU = 0.; ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:324:55: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble detD = 1000*meas.valueSimulated(1); if(fabs(detD) <= 1.e-9 ) detD = 0.; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:324:55: note: use function 'std::abs' instead ALIdouble detD = 1000*meas.valueSimulated(1); if(fabs(detD) <= 1.e-9 ) detD = 0.; ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:325:55: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble detL = 1000*meas.valueSimulated(2); if(fabs(detL) <= 1.e-9 ) detL = 0.; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:325:55: note: use function 'std::abs' instead ALIdouble detL = 1000*meas.valueSimulated(2); if(fabs(detL) <= 1.e-9 ) detL = 0.; ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:326:55: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] ALIdouble detR = 1000*meas.valueSimulated(3); if(fabs(detR) <= 1.e-9 ) detR = 0.; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:326:55: note: use function 'std::abs' instead ALIdouble detR = 1000*meas.valueSimulated(3); if(fabs(detR) <= 1.e-9 ) detR = 0.; ^~~~ std::abs ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:401:12: warning: absolute value function 'fabs' given an argument of type 'ALIdouble' (aka 'long double') but has parameter of type 'double' which may cause truncation of value [-Wabsolute-value] sign = fabs(sign)/sign; ^ ${CMSSW_BASE}/src/Alignment/CocoaModel/src/OptOCOPS.cc:401:12: note: use function 'std::abs' instead sign = fabs(sign)/sign; ^~~~ std::abs
@davidlange6 I agree that it is a valid warning, that's why I explicitely mentioned it in the PR description. Probably an assert would be better here, as I learned from your link |
@ghellwig I can contact privately Zoltan who I think is the only regular user of that code. I am not aware of him being on gitHub... |
@cmsbuild please test |
The tests are being triggered in jenkins. |
@mmusich David also tried it for the 81X version w/o success, but he merged it anyways |
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_8_0_X IBs after it passes the integration tests. This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @Degano, @smuzaffar |
Fixes all clang warning originating from the
Alignment
code, except this oneI did not want to remove this "protection" because some not well-defined code might rely on this.
Backport of #14875