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
Make theVerboseLevel constexpr #7192
Make theVerboseLevel constexpr #7192
Conversation
The static analyzer was complaining about the file static theVerboseLevel in SiPixelTemplateSplit. Since the value is never changed at run time the variable was marked as constexpr.
A new Pull Request was created by @Dr15Jones (Chris Jones) for CMSSW_7_4_X. Make theVerboseLevel constexpr It involves the following packages: RecoLocalTracker/SiPixelRecHits @cmsbuild, @cvuosalo, @nclopezo, @slava77 can you please review it and eventually sign? Thanks. |
@@ -47,7 +47,7 @@ | |||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | |||
#define LOGERROR(x) edm::LogError(x) | |||
#define LOGDEBUG(x) LogDebug(x) | |||
static int theVerboseLevel = 2; | |||
static constexpr int theVerboseLevel = 2; |
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.
does it make sense to be static here? could just be constexpr int theVerboseLevel = 2;
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.
I think should be not static and enclosed in anonymous namespace
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.
Static guarantees the symbol is not exported. I've never checked to see if anonymous namespaces have the same guarantee.
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.
that's the role of "anonymous namespace" in C++ (w/r/t static as "local-to-file" in C)
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.
@Dr15Jones will you change this or do we stick to static?
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.
Given all the stuff I have on my plate and that we use static
much more than unnamed namespaces I'd prefer to keep it as it is.
@cmsbuild please test (compile is enough) |
The tests are being triggered in jenkins. |
@cmsbuild please test |
Looks like jenkins stepped on itself https://cmssdt.cern.ch/jenkins/job/auto-trigger-pr-tests/5081/console |
.. this one is a problematic PR:
Chris, you have most of them. Is it a special way you submit PRs? |
It's a bug in github. It seems to happen if you tell github to create a pull request within a very short time of uploading the commits to github. I hadn't seen the problem in months so I thought they had fixed the race condition. Guess I'll have to go back to waiting 5 minutes or so before creating a pull request. |
@ktf any ideas? |
This pull request is fully signed and it will be integrated in one of the next CMSSW_7_4_X IBs unless changes or unless it breaks tests. |
@ktf Jenkins can't get the test to run. I'd bet on Slava's tests being sufficient. |
…ateSplit Make theVerboseLevel constexpr
Yeah... I'll contact github support to see if they have any insight about this. |
The static analyzer was complaining about the file static
theVerboseLevel in SiPixelTemplateSplit. Since the value is never
changed at run time the variable was marked as constexpr.