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
CondFormats/JetMETObjects : Fix clang static analyzer warnings #16283
CondFormats/JetMETObjects : Fix clang static analyzer warnings #16283
Conversation
Data Class Const Correctness Const function returns pointer or reference to non-const member data object /CondFormats/JetMETObjects/interface/JetResolutionObject.h unknown 190 Data Class Const Correctness Const function returns pointer or reference to non-const object /CondFormats/JetMETObjects/interface/JetResolutionObject.h getFormula 189
A new Pull Request was created by @gartung (Patrick Gartung) for CMSSW_8_1_X. It involves the following packages: CondFormats/JetMETObjects @ggovi, @cmsbuild, @monttj, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here #13028 |
please test |
The tests are being triggered in jenkins. |
-1 Tested at: bcdb9f9 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: You can see the results of the tests here: I found follow errors while testing this PR Failed tests: Build ClangBuild
I found an error when building: >> Compiling /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/CondFormats/JetMETObjects/src/QGLikelihoodObject.cc >> Compiling /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/CondFormats/JetMETObjects/src/JetResolution.cc >> Compiling /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/CondFormats/JetMETObjects/src/JetCorrectorParameters.cc >> Compiling tmp/slc6_amd64_gcc530/src/CondFormats/JetMETObjects/src/CondFormatsJetMETObjects/a/Serialization.cc /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/CondFormats/JetMETObjects/src/JetResolutionObject.cc: In member function 'float JME::JetResolutionObject::evaluateFormula(const JME::JetResolutionObject::Record&, const JME::JetParameters&) const': /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/CondFormats/JetMETObjects/src/JetResolutionObject.cc:388:52: error: invalid conversion from 'const TFormula_' to 'TFormula_' [-fpermissive] TFormula\* formula = m_definition.getFormula(); ^ >> Compiling /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/Geometry/HGCalCommonData/src/HGCalGeometryMode.cc >> Compiling /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/Geometry/HGCalCommonData/src/HGCalParameters.cc Entering library rule at Geometry/CaloTopology
I found a compilation error while trying to compile with clang: >> Compiling edm plugin /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/FWCore/Integration/test/TestGetterOfProducts.cc >> Compiling edm plugin /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/FWCore/Integration/test/ValueExamplePlugin.cc >> Compiling edm plugin /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/FWCore/Integration/test/Doodad.cc >> Compiling edm plugin /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/FWCore/Integration/test/DoodadESSource.cc >> Compiling edm plugin /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/FWCore/Integration/test/GadgetRcd.cc /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/CondFormats/JetMETObjects/src/JetResolutionObject.cc:388:19: error: cannot initialize a variable of type 'TFormula _' with an rvalue of type 'const TFormula *' TFormula_ formula = m_definition.getFormula(); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~ >> Compiling edm plugin /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/FWCore/Integration/test/ProdigalAnalyzer.cc >> Compiling /build/cmsbld/jenkins-workarea/workspace/ib-any-integration/CMSSW_8_1_X_2016-10-20-1100/src/FWCore/Integration/test/ValueExample.cc 1 error generated. The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison not run due to Build errors (RelVals and Igprof tests were also skipped) |
Doh. I forgot to compiler after fixing the static analyzer warning. |
Pull request #16283 was updated. @ggovi, @cmsbuild, @monttj, @davidlange6 can you please check and sign again. |
@@ -385,7 +385,7 @@ namespace JME { | |||
return 1; | |||
|
|||
// Set parameters | |||
TFormula* formula = m_definition.getFormula(); | |||
TFormula* formula = new TFormula( * (m_definition.getFormula() ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to do
auto const* pFormula = m_definition.getFormula();
if( ! formula) { return 1;}
return TFormula(*pFormula)->EvalPar(variables_);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite. The formula is modified with new parameters.
Pull request #16283 was updated. @ggovi, @cmsbuild, @monttj, @davidlange6 can you please check and sign again. |
Pull request #16283 was updated. @ggovi, @cmsbuild, @monttj, @davidlange6 can you please check and sign again. |
please test |
The tests are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
+1 |
Data Class Const Correctness Const function returns pointer or reference to non-const member data object /CondFormats/JetMETObjects/interface/JetResolutionObject.h unknown 190
Data Class Const Correctness Const function returns pointer or reference to non-const object /CondFormats/JetMETObjects/interface/JetResolutionObject.h getFormula 189