Problem 1420

Summary: 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
Product: Geant4 Reporter: a.ramazani
Component: geometry/solidsAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED FIXED    
Severity: normal CC: a.ramazani
Priority: P5    
Version: 9.6   
Hardware: PC   
OS: Windows   

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.