PVS-StudioWarnings

PVS-Studio warning V517 for Geant4

Nov 17th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. void G4QMessenger::SetNewValue(G4UIcommand* aComm, G4String aS)
  2. {
  3.   if(photoDir)
  4.   {
  5.     if     (aComm==theSynchR) thePhoto->SetSynchRadOnOff(aS);
  6.     else if(aComm==minGamSR)  thePhoto->SetMinGammaSR(....
  7.     else if(aComm==theGamN)   thePhoto->SetGammaNuclearOnOff(aS);
  8.     else if(aComm==theMuoN)   thePhoto->SetElPosNuclearOnOff(aS);
  9.     else if(aComm==theMuoN)   thePhoto->SetMuonNuclearOnOff(aS);
  10.     else if(aComm==theMuoN)   thePhoto->SetTauNuclearOnOff(aS);
  11.     else if(aComm==biasPhotoN)thePhoto->SetPhotoNucBias(....
  12.   }
  13.   ....
  14. }
  15.  
  16. This suspicious code was found in Geant4 project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 195, 196. G4phys_builders g4qmessenger.cc 195
  19.  
  20. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment