-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
GeneratorInterface/LHEInterface : formatting fix for statements flagged by gcc 6.0 indentation warning #15065
GeneratorInterface/LHEInterface : formatting fix for statements flagged by gcc 6.0 indentation warning #15065
Conversation
A new Pull Request was created by @gartung (Patrick Gartung) for CMSSW_8_1_X. It involves the following packages: GeneratorInterface/LHEInterface @covarell, @perrozzi, @thuer, @cmsbuild, @davidlange6, @govoni can you please review it and eventually sign? Thanks. cms-bot commands are list here #13028 |
@@ -306,7 +306,7 @@ std::auto_ptr<HepMC::GenEvent> LHEEvent::asHepMCEvent() const | |||
genVertices.push_back(current_vtx); | |||
} | |||
|
|||
for(unsigned int j = mother1; j <= mother2; j++) // set mother-daughter relations | |||
for(unsigned int j = mother1; j <= mother2; j++) { // set mother-daughter relations | |||
if (!genParticles.at(j)->end_vertex()) | |||
current_vtx->add_particle_in(genParticles.at(j)); | |||
|
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.
Line 309 was flagged as not guarding line 314 because of a missing opening curly brace. The indentation would seem to indicate that was what the author intended.
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 don't think this is right. With your new code, we get mother2-mother1+1
copies of particle i
added to the current current_vtx
. I'm pretty sure we only want one which is what the original code would do.
The original code would only proceed if mother1
!= 0 which is probably sensible since we are translating from FORTRAN and the number there would start at 1.
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.
Let's keep the logic from the original code but just change the indentation to make the compiler happy.
@Dr15Jones Does this bug fix look correct to you? |
please test |
The tests are being triggered in jenkins. |
/home/cms_admin/CMSSW_8_1_X_2016-06-28-1400/src/GeneratorInterface/LHEInterface/src/LHEEvent.cc: In member function 'std::auto_ptr<HepMC::Ge
nEvent> lhef::LHEEvent::asHepMCEvent() const':
/home/cms_admin/CMSSW_8_1_X_2016-06-28-1400/src/GeneratorInterface/LHEInterface/src/LHEEvent.cc:309:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(unsigned int j = mother1; j <= mother2; j++) // set mother-daughter relations
^~~
/home/cms_admin/CMSSW_8_1_X_2016-06-28-1400/src/GeneratorInterface/LHEInterface/src/LHEEvent.cc:314:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'
current_vtx->add_particle_out(genParticles.at(i));
^~~~~~~~~~~