PVS-StudioWarnings

PVS-Studio warning V674 for Geant4

Nov 11th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. G4StatMFChannel * G4StatMFMicroPartition::ChooseZ(
  2.   const G4double A0, const G4double Z0, const G4double MeanT)
  3. // Gives fragments charges
  4. {
  5.   ....
  6.   G4int ZBalance = 0;
  7.   ....
  8.   while (std::abs(ZBalance) > 1.1);
  9. }
  10.  
  11. This suspicious code was found in Geant4 project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V674 The '1.1' literal of the 'double' type is compared to a value of the 'int' type. Consider inspecting the 'std::abs(ZBalance) > 1.1' expression. G4hadronic_deex_multifragmentation g4statmfmicropartition.cc 351
  14.  
  15. 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