Problem 1420 - The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 799, 808. g4vtwistsurface.cc 799
Summary: The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a ...
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: 9.6
Hardware: PC Windows
: P5 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2012-12-31 13:21 CET by a.ramazani
Modified: 2013-01-11 16:20 CET (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description a.ramazani 2012-12-31 13:21:01 CET
The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 799, 808. g4vtwistsurface.cc 799


error:        if (areacode & sC0Min1Max) {

correct:      if (areacode & sC0Min1Min) {


I used The Best C++ static code analysis Tools "PVS-Studio 4.77" under Visual Studio 2012 to analyze the Geant4.9.6 code
There is many warnings and performance optimization so I recommend using PVS-Studio 
http://files.viva64.com/beta/PVS-Studio_setup.exe

Please correct me if I am wrong 
Thanks in Advance.
Comment 1 Gabriele Cosmo 2013-01-11 16:20:31 CET
Thanks for reporting this. The fix is now in the development trunk and will be made available in the next patch release.