-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[CLANG] Fix compilation error with LLVM 9.0.1 #28795
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28795/13480
|
A new Pull Request was created by @smuzaffar (Malik Shahzad Muzaffar) for master. It involves the following packages: DataFormats/TrackerRecHit2D @perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
The tests are being triggered in jenkins. |
+1 |
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, @silviodonato, @fabiocos (and backports should be raised in the release meeting by the corresponding L2) |
@@ -22,7 +22,7 @@ namespace fastTrackerRecHitType { | |||
siStripProjectedStereo2D = 5, | |||
}; | |||
inline trackerHitRTTI::RTTI rtti(HitType hitType) { | |||
if (hitType >= 0 && hitType <= 2) | |||
if (hitType >= siPixel && hitType <= siStrip2D) |
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 comparing to literal 0
is bad, but comparing to siPixel
that has a value 0
is fine? I mean, hitType >= siPixel
is still a tautology assuming the caller passes only valid HitType
values.
(I'm not objecting the proposed fix, just wondering out loud)
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 @makortel , at least llvm does not complain any more. May be the check should be change to
if (hitType <= siStrip2D)
or
if (hitType <= 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 agree this behavior looks a bit weird. However, since LLVM does not complain anymore, I would keep if (hitType >= siPixel && hitType <= siStrip2D)
. It seems more clear to me.
+1 |
Fix compilation error [a] which we see while using LLVM 9.0.1
[a]