Problem 468

Summary: assignment within conditional expression
Product: Geant4 Reporter: novikova
Component: processes/hadronic/modelsAssignee: Hans-Peter.Wellisch
Status: RESOLVED INVALID    
Severity: normal    
Priority: P2    
Version: 4.1   
Hardware: All   
OS: All   

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.