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-SiPixelObjects fix clang warnings about abs and mismatched tags #16921
CondFormats-SiPixelObjects fix clang warnings about abs and mismatched tags #16921
Conversation
A new Pull Request was created by @gartung (Patrick Gartung) for CMSSW_9_0_X. It involves the following packages: CondFormats/SiPixelObjects @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @ggovi, @mmusich, @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. |
Comparison job queued. |
@@ -3,7 +3,7 @@ | |||
#include <cstdlib> | |||
|
|||
short SiPixelCalibConfiguration::vcalIndexForEvent(const uint32_t & eventnumber) const{ | |||
uint32_t relative_event = abs(eventnumber-1)%patternSize(); | |||
uint32_t relative_event = (eventnumber-1)%patternSize(); |
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.
so presumably the original intent was not abs(eventnumber-1) but rather to protect against the case of eventnumber=0
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.
Wouldn't unsigned int 0 - 1 = max unsigned int?
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.
yes, i just am not sure if that is the desired behavior. I'll let that get answered in the review process.
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.
@davidlange6 I changed this in a follow up commit.
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
+1 |
+1 |
This pull request is fully signed and it will be integrated in one of the next CMSSW_9_0_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar |
+1 |
In file included from CondFormatsSiPixelObjects/a/CondFormatsSiPixelObjects_xr.cc:41:
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/src/classes.h:20:10: warning: class template 'PixelDCSObject' was previously declared as a struct template [-Wmismatched-tags]
template class PixelDCSObject;
^
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/interface/PixelDCSObject.h:22:8: note: previous use is here
struct PixelDCSObject
^
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/src/classes.h:20:10: note: did you mean struct here?
template class PixelDCSObject;
^~~~~
struct
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/src/classes.h:21:10: warning: class template 'PixelDCSObject' was previously declared as a struct template [-Wmismatched-tags]
template class PixelDCSObject;
^
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/interface/PixelDCSObject.h:22:8: note: previous use is here
struct PixelDCSObject
^
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/src/classes.h:21:10: note: did you mean struct here?
template class PixelDCSObject;
^~~~~
struct
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/src/classes.h:22:10: warning: class template 'PixelDCSObject' was previously declared as a struct template [-Wmismatched-tags]
template class PixelDCSObject;
^
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/interface/PixelDCSObject.h:22:8: note: previous use is here
struct PixelDCSObject
^
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/src/classes.h:22:10: note: did you mean struct here?
template class PixelDCSObject;
^~~~~
struct
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/src/SiPixelCalibConfiguration.cc:6:29: warning: taking the absolute value of unsigned type 'unsigned int' has no effect [-Wabsolute-value]
uint32_t relative_event = abs(eventnumber-1)%patternSize();
^
/build/cmsbld/jenkins-workarea/workspace/build-any-ib/w/tmp/BUILDROOT/7a46df93c511389b47098a1f5c9e31bc/opt/cmssw/slc6_amd64_gcc530/cms/cmssw/CMSSW_9_0_CLANG_X_2016-12-08-1100/src/CondFormats/SiPixelObjects/src/SiPixelCalibConfiguration.cc:6:29: note: remove the call to 'abs' since unsigned values cannot be negative
uint32_t relative_event = abs(eventnumber-1)%patternSize();
^~~