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 compilation warning #25687
Fix compilation warning #25687
Conversation
The code-checks are being triggered in jenkins. |
public: | ||
using TrajParams = std::vector<LocalTrajectoryParameters>; | ||
using Chi2sFive = std::vector<unsigned char>; | ||
|
||
/// default constructor | ||
TrackExtraBase() : m_firstHit(-1), m_nHits(0) { } | ||
TrackExtraBase() : m_firstHit((unsigned int) -1), m_nHits(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.
would it be better to initialise this to 0
instead ?
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.
It is evident that m_firstHit
is never used at its initialization value: therefore either "0" or the number corresponding to the maximum size result in the same final behavior. Maybe, having 0 hits and the first one located in the maximum possible unsigned int number as initialization values can make sense, even though I agree with you that initializing an unsigned type to "-1" can look odd.
However, your proposed fix silences clang without modifying anything in what was originally there: I would stick on it.
@cmsbuild please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25687/8054
|
The tests are being triggered in jenkins. |
A new Pull Request was created by @fwyzard (Andrea Bocci) for master. It involves the following packages: DataFormats/TrackReco @perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
The code-checks are being triggered in jenkins. |
Fix clang warning: integer conversion resulted in a change of sign.
The code-checks are being triggered in jenkins. |
Note that the widespread whitespace changes are due to fixing the line endings from OSX to Unix. |
@cmsbuild, please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-25687/8056
|
The tests are being triggered in jenkins. |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
Fix clang warning: integer conversion resulted in a change of sign.