-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fixing warnings during building related to nutaudet folder, about unused or uninitialized variables #481
Fixing warnings during building related to nutaudet folder, about unused or uninitialized variables #481
Conversation
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.
First of all, thanks!
Some remarks:
- For unused variables that are needed (e.g. the different shapes/volumes): Please use the
[[maybe_unused]]
attribute instead of adding unnecessary statements. - I don't think we need to make these fixes for the
charmdet
dir, as I believe they are outdated relative to themuonflux
branch anyway. I would propose removingcharmdet
from themaster
branch 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.
Nearly perfect.
Could you please also add a line to the change log?
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.
See comment, everything else looks good to me now.
Before the final merge, you'd have to rebase to deal with the conflict in the CHANGELOG.md.
713d24c
to
733beff
Compare
Done, I had to force push afterwards, because git complained about the changed history. |
In general, you'll have to do a force push after a rebase. Next time, please do it as the last thing, once everything else is resolved, as it makes it harder to review the changes. This time it's fine though, as there were very few outstanding issues. |
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.
99% perfect ;)
Sorry for being so nitpicky!
@antonioiuliano2 Can you please give an estimate of when the requested changes can be implemented? (or let me know if you disagree with any comments?) This PR has now been open for 3 months. Thanks! |
Sorry, I finally got back to this pull request, I have checked all the remaining comments |
Thanks a lot! |
Yes, that is great, thanks! Co-authored-by: Oliver Lantwin <oliver.lantwin@cern.ch>
7bddd5b
to
3818c2f
Compare
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.
Thanks a lot for this cleanup, and the patience with my suggestions!
…sed or uninitialized variables (ShipSoft#481) * fixing warnings during building, about unused or uninitialized variables * labeling not directly used volume variables with maybe unused * replacing volTungsten and volLead with a single volAbsorber variable * do not repeat name of the TGeoBBox pointer * using auto* to avoid repeating type, fixing whitespaces * ternary operator instead of if else, small indentation fixes * adding pull request info to CHANGELOG * using same names for lead and tungsten volumes * boolean initialization to false instead of 0 * Update nutaudet/Target.cxx Yes, that is great, thanks! Co-authored-by: Oliver Lantwin <oliver.lantwin@cern.ch> * setname of shape immediately for easier readability * replacing C-style cast with static cast * set TGeoBBox name directly at object creation --------- Co-authored-by: Oliver Lantwin <oliver.lantwin@cern.ch>
Dear all FairShip users,
This commit fixes all nutaudet warnings happening during building the code.
They were about either unused or uninitialized variables: most of the times the warnings were genuine, i.e. the variable was actually "forgotten" in the code and never used. In other instances, however, the object was actually used, even if the variable was not. This happens a lot with TGeoShapes, since we define the variable when we build the shape, but we do not use the variable itself in the code. I fixed these warnings by addind a redundant SetName call after building the shape.
I attach the initial log with the warnings, as provided by @olantwin, for reference. I also attach the new log, without nutaudet warnings.
I will fix the charmdet warnings in another branch, since they are related to a completely different geometry.
Best Regards,
Antonio
FairShip_Oliver.log
fixingnutaudetwarnings_build.log