-
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
Geometry/HGCalCommonData: array bounds warning/error from gcc13.3.1 build #47217
Comments
cms-bot internal usage |
A new Issue was created by @gartung. @Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
Warning appears to be legitimate |
assign Geometry/HGCalCommonData |
New categories assigned: geometry,upgrade @bsunanda,@civanch,@Dr15Jones,@kpedro88,@makortel,@mdhildreth,@Moanwar,@srimanob,@subirsarkar you have been requested to review this Pull request/Issue and eventually sign? Thanks |
Orignal PR: #47077 . Similar issue corrected in #47148 . @Pruthvi-ch FYI |
In most cases this "for - switch" structure cmssw/Geometry/HGCalCommonData/src/HGCalCellOffset.cc Lines 272 to 274 in 7f549d8
is an anti-pattern leading to difficult-to-read code (which, at least to me, is the case here). I'd suggest to reorganize the loops over j as explicit blocks of code, i.e. replace
for (int j = HGCalCell::partiaclWaferCellsOffset; j < (25 + HGCalCell::partiaclWaferCellsOffset);
++j) { //For cells in partial wafers
if (j == (HGCalCell::halfCell)) {
// ...
double xMag = ((-2.0 * sqrt3_ * cellX_[k] / 9.0) * totalArea - (cutArea * x1)) /
(cellAreaPartial[k][j - HGCalCell::partiaclWaferCellsOffset]);
// ... with something along {
auto const cellIndex = HGCalCell::halfCell - HGCalCell::partiaclWaferCellsOffset;
// ...
double xMag = ((-2.0 * sqrt3_ * cellX_[k] / 9.0) * totalArea - (cutArea * x1)) /
(cellAreaPartial[k][cellIndex]); Separating each case into its own member function. I also noticed the cmssw/Geometry/HGCalCommonData/interface/HGCalCellOffset.h Lines 28 to 29 in 7f549d8
members don't follow the naming convention of the other members. It would be more clear to add a trailing _ to them.
|
The text was updated successfully, but these errors were encountered: