PVS-StudioWarnings

PVS-Studio warning V519 for Geant4

Nov 20th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. void G4Incl::processEventIncl(G4InclInput *input)
  2. {
  3.   ....
  4.   varntp->mzini = izrem;
  5.   varntp->exini = esrem;
  6.   varntp->pxrem = pxrem;
  7.   varntp->pyrem = pyrem;
  8.   varntp->pzrem = pzrem;
  9.   varntp->mcorem = mcorem;
  10.   varntp->erecrem = pcorem;
  11.   varntp->erecrem = erecrem;
  12.   ....
  13. }
  14.  
  15. Most likely this is what should be written here: varntp->pcorem = pcorem;
  16.  
  17. This suspicious code was found in Geant4 project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V519 The 'varntp->erecrem' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 896, 897. g4incl.cc 897
  20.  
  21. 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