PVS-StudioWarnings

PVS-Studio warning V517 for Geant4

Nov 19th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. G4String G4PersistencyCenterMessenger::GetCurrentValue(
  2.   G4UIcommand* command)
  3. {
  4.   G4String s="Undefined";
  5.  
  6.   if (command==select)
  7.   {
  8.     return pc->VerboseLevel();
  9.   }
  10.   else if (command==select)
  11.   {
  12.     return pc->CurrentSystem();
  13.   }
  14.   else if (command==regHitIO)
  15.   {
  16.   ....
  17. }
  18.  
  19. This suspicious code was found in Geant4 project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 207, 211. G4mctruth g4persistencycentermessenger.cc 207
  22.  
  23. 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