Problem 468 - assignment within conditional expression
Summary: assignment within conditional expression
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/hadronic/models (show other problems)
Version: 4.1
Hardware: All All
: P2 normal
Assignee: Hans-Peter.Wellisch
URL:
Depends on:
Blocks:
 
Reported: 2003-03-19 11:50 CET by novikova
Modified: 2003-03-20 06:01 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description novikova 2003-03-19 11:50:50 CET
I changed the warnings level on my compiler, and it came up with the following
message:

..\geant4.5.0.p01
\source\processes\hadronic\models\generator\quark_gluon_string\include\G4QGSMode
l.icc(90) : error C4706: assignment within conditional expression

Translation:
The code the compiler points to is the following
<<<
while(aPair = theParticipants.GetNextPartonPair())
  {
    if (aPair->GetCollisionType() == G4PartonPair::DIFFRACTIVE)
    {
      aString = theDiffractiveStringBuilder.BuildString(aPair);
//      G4cout << "diffractive "<<aString->Get4Momentum()<<endl;
    }
    else
    {
      aString = theSoftStringBuilder.BuildString(aPair);
//      G4cout << "soft "<<aString->Get4Momentum()<<endl;
    }
    aString->Boost(theCurrentVelocity);
    theStrings->push_back(aString);
    delete aPair;
  }
>>>

Might it be that the first line here should actually read
<<<
while(aPair == theParticipants.GetNextPartonPair())
>>>
???

Thanks,
-- Elena.
P.S. Probably it makes sense to bump up the level of compiler warings when
compiling Geant...
Comment 1 Hans-Peter.Wellisch 2003-03-20 06:01:59 CET
Hi Elena,

 this is correct as it. It is just the compiler that tries to be too smart, and
trips up.

Many greetings,

Hans-Peter.