Skip to content
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

Merged
merged 2 commits into from Jan 6, 2017
Merged

CondFormats-SiPixelObjects fix clang warnings about abs and mismatched tags #16921

merged 2 commits into from Jan 6, 2017

Conversation

gartung
Copy link
Member

@gartung gartung commented Dec 8, 2016

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();
^~~

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 8, 2016

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.
@ghellwig, @apfeiffer1, @dkotlins, @tocheng, @VinInn this is something you requested to watch as well.
@slava77, @smuzaffar you are the release manager for this.

cms-bot commands are listed here #13028

@mmusich
Copy link
Contributor

mmusich commented Dec 9, 2016

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2016

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/16890/console Started: 2016/12/09 09:39

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2016

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2016

Comparison job queued.

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2016

@@ -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();
Copy link
Contributor

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

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

@gartung gartung Dec 12, 2016

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.

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 9, 2016

Pull request #16921 was updated. @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @ggovi, @mmusich, @davidlange6 can you please check and sign again.

@davidlange6
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 10, 2016

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/16941/console Started: 2016/12/10 14:39

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

@mmusich
Copy link
Contributor

mmusich commented Dec 11, 2016

+1

@ggovi
Copy link
Contributor

ggovi commented Jan 5, 2017

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Jan 5, 2017

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

@davidlange6
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit f40e0e6 into cms-sw:CMSSW_9_0_X Jan 6, 2017
@gartung gartung deleted the CondFormats-SiPixelObjects-fix-clang-warnings branch January 18, 2017 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants