View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0024167 | Open CASCADE | OCCT:Modeling Algorithms | public | 2013-09-12 16:46 | 2013-12-19 13:58 |
Reporter | Assigned To | bugmaster | |||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Platform | Windows | OS | VC++ 2010 | ||
Product Version | 6.7.0 | ||||
Target Version | 6.7.0 | Fixed in Version | 6.7.0 | ||
Summary | 0024167: Compiler warnings 'unreacheable code' and 'conditional expression is constant' in MOA | ||||
Description | On VC 2010 (RElease mode) with warning level 4 the following warnings are reported in modeling code: Warning 9 warning C4702: unreachable code d:\occt\src\brepcheck\brepcheck_face.cxx 662 TKTopAlgo Warning 10 warning C4702: unreachable code d:\occt\src\brepclass3d\brepclass3d.cxx 121 TKTopAlgo Warning 13 warning C4702: unreachable code d:\occt\src\boptools\boptools_algotools3d.cxx 786 TKBO Warning 15 warning C4702: unreachable code d:\occt\src\brepalgo\brepalgo_facerestrictor.cxx 264 TKBool Warning 29 warning C4702: unreachable code d:\occt\src\qanewmodtopope\qanewmodtopope_glue_wire.cxx 982 TKQADraw Warning 2 warning C4127: conditional expression is constant D:\occt\src\math\math_FunctionRoots.cxx 227 TKMath Warning 3 warning C4127: conditional expression is constant D:\occt\src\math\math_FunctionRoots.cxx 495 TKMath Warning 4 warning C4127: conditional expression is constant D:\occt\src\math\math_FunctionRoots.cxx 506 TKMath Warning 5 warning C4127: conditional expression is constant D:\occt\src\math\math_FunctionRoots.cxx 980 TKMath Warning 6 warning C4127: conditional expression is constant D:\occt\inc\IntCurveSurface_Polyhedron.gxx 198 TKGeomAlgo Warning 7 warning C4127: conditional expression is constant D:\occt\inc\IntCurveSurface_Polyhedron.gxx 289 TKGeomAlgo Warning 16 warning C4127: conditional expression is constant D:\occt\src\ChFi3d\ChFi3d_Builder_C1.cxx 1254 TKFillet Warning 17 warning C4127: conditional expression is constant D:\occt\src\ChFi3d\ChFi3d_Builder_C1.cxx 1379 TKFillet Warning 18 warning C4127: conditional expression is constant D:\occt\src\ChFi3d\ChFi3d_Builder_C1.cxx 1389 TKFillet In addition, in Debug mode: Warning 6 warning C4127: conditional expression is constant D:\occt\src\BRepTools\BRepTools_GTrsfModification.cxx 126 TKBRep Warning 7 warning C4127: conditional expression is constant D:\occt\src\BRepTools\BRepTools_GTrsfModification.cxx 174 TKBRep | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
Dear ifv, Please, test the current state of branch CR24167 to be sure it is still OK. |
|
I think that it is better in BRepTools_GTrsfModification replace Standard_NoSuchObject_Raise_if(1,"BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Surface"); directly by Standard_NoSuchObject::Raise(MESSAGE); instead of your suggestion Standard_Boolean messageFlag = 1; Standard_NoSuchObject_Raise_if(messageFlag,"BRepTools_GTrsfModification : Pb no BSpline/Bezier Type Surface"); |
|
Dear ifv, I implemented your suggestions, please re-check code in branch CR24167. |
|
Ok |
|
Dear aml,- for (i=1; i<=aNbDomains; ++i) { + for (i=1; i<=aNbDomains; /*++i*/) { - exp.Next()) { + /*exp.Next()*/) { - for (; aIt.More(); aIt.Next()) { + for (; aIt.More(); /*aIt.Next()*/) { If all this loops have been designed to read only first value - please change them to "if" statements instead of commenting code. - const Standard_Boolean variant1 = Standard_True; + //const Standard_Boolean variant1 = Standard_True; -static const Standard_Integer methode = 1; //-- 1:(Nv Traitement) 3:(Nv + Ancien +check) 2:(Ancien) +//static const Standard_Integer methode = 1; //-- 1:(Nv Traitement) 3:(Nv + Ancien +check) 2:(Ancien) Please do not leave dead code in commented state - remove it. +#define NEWCODE +//#define OLDCODE +//#define CHECK I consider new macros should have more descriptive names - at least prefixed with local name to avoid theoretical name collisions. |
|
Dear ifv, Please check current state of branch CR24167 according to new notes. |
|
in BOPTools_AlgoTools3D.cxx if (aNbDomains == 1) { must be if (aNbDomains > 0) { Algorithm uses only first Domain, but there can be some Domains. if(aNbDomains == 0) it is necessary return error code the same as for case when Hatcher is not done: if (!bIsDone) { iErr=2; return iErr; } Remove unnecessary "break" (line 806) In BRepAlgo_FaceRestrictor.cxx exp.Init(wir,TopAbs_EDGE); if (!exp.Current().IsNull()) { it is better if(exp.More()) { exp.Current() raises exception if !exp.More() BRepCheck_Face.cxx, BRepClass3d.cxx - the same as above. |
|
Dear ifv, I implemented your suggestions, please re-check code in branch CR24167. |
|
in BOPTools_AlgoTools3D.cxx checking .... else if (aNbDomains == 0) { is not necessary It is enough: if(aNbDomains > 0) { Correct case } else { Error } |
|
dear ifv, I implemented your corrections please check branch CR24167. |
|
Ok |
|
Dear BugMaster, Branch CR24167 (and products from GIT master) was compiled on Linux and Windows platforms and tested. SHA-1: bcc017d830857839c1954085a55990711d2636a7 Number of compiler warnings: occt component : Linux: 506 (506 on master) Windows: 20 (31 on master) products component : Linux: 190 (190 on master) Windows: 287 (287 on master) Regressions: No regressions Improvements: No improvements Testing cases: Not needed Testing on Linux: Total MEMORY difference: 366373524 / 366214652 Total CPU difference: 43783.69000000105 / 42280.380000000965 Testing on Windows: Total MEMORY difference: 428752700 / 429010728 Total CPU difference: 47344.75 / 48288.609375 There are not differences in images found by testdiff. |
|
Pardon, why warnings in qanewmodtopope_glue_wire.cxx and IntCurveSurface_Polyhedron.gxx have not been fixed?! |
|
Dear Alexander, probably you missed two cases. Please fix. |
|
Yes, it's my fault. I forgot about this files. |
|
Alexander, please register separate issue for fixing remaining files (make it a child of this one). Besides, please be careful fixing GXX files: you can easily modify the file located in inc folder instead of the one located in src. |
|
Igor, please switch this issue back to Verified: the remaining will be fixed in context of 0024222 |
occt: master 3ed30348 2013-10-03 10:07:10
Committer: bugmaster Details Diff |
0024167: Compiler warnings 'unreacheable code' and 'conditional expression is constant' in MOA Resolved some C4702 (unreachable code) and C4127 (conditional expression is constant). small corrections in NoSuchObject invoking. Macros names changing, deadcode deleting, re-writing "for" loops into equivalent "if" structures. changed condition in "if" block, deadcode deleted. Small changes in else statement. |
Affected Issues 0024167 |
|
mod - src/BOPTools/BOPTools_AlgoTools3D.cxx | Diff File | ||
mod - src/BRepAlgo/BRepAlgo_FaceRestrictor.cxx | Diff File | ||
mod - src/BRepCheck/BRepCheck_Face.cxx | Diff File | ||
mod - src/BRepClass3d/BRepClass3d.cxx | Diff File | ||
mod - src/BRepTools/BRepTools_GTrsfModification.cxx | Diff File | ||
mod - src/ChFi3d/ChFi3d_Builder_C1.cxx | Diff File | ||
mod - src/math/math_FunctionRoots.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-09-12 16:46 |
|
New Issue | |
2013-09-12 16:46 |
|
Assigned To | => ifv |
2013-09-12 17:01 |
|
Relationship added | related to 0023947 |
2013-09-12 17:13 |
|
Description Updated | |
2013-09-13 08:49 |
|
Status | new => assigned |
2013-09-16 16:54 |
|
Assigned To | ifv => aml |
2013-09-19 14:43 |
|
Note Added: 0025653 | |
2013-09-19 14:43 |
|
Assigned To | aml => ifv |
2013-09-19 14:43 |
|
Status | assigned => resolved |
2013-09-19 15:41 |
|
Note Added: 0025655 | |
2013-09-19 15:41 |
|
Assigned To | ifv => aml |
2013-09-19 15:41 |
|
Status | resolved => feedback |
2013-09-20 13:10 |
|
Note Added: 0025672 | |
2013-09-20 13:10 |
|
Assigned To | aml => ifv |
2013-09-20 13:10 |
|
Status | feedback => resolved |
2013-09-20 13:21 |
|
Note Added: 0025673 | |
2013-09-20 13:21 |
|
Status | resolved => reviewed |
2013-09-20 14:27 | kgv | Note Added: 0025675 | |
2013-09-20 14:27 | kgv | Assigned To | ifv => aml |
2013-09-20 14:27 | kgv | Status | reviewed => assigned |
2013-09-20 15:30 |
|
Note Added: 0025676 | |
2013-09-20 15:30 |
|
Assigned To | aml => ifv |
2013-09-20 15:30 |
|
Status | assigned => resolved |
2013-09-20 16:43 |
|
Note Added: 0025679 | |
2013-09-20 16:43 |
|
Status | resolved => feedback |
2013-09-20 17:26 |
|
Note Added: 0025682 | |
2013-09-20 17:26 |
|
Status | feedback => resolved |
2013-09-23 09:58 |
|
Note Added: 0025693 | |
2013-09-23 09:58 |
|
Status | resolved => feedback |
2013-09-23 09:59 |
|
Assigned To | ifv => aml |
2013-09-23 10:22 |
|
Note Added: 0025696 | |
2013-09-23 10:22 |
|
Assigned To | aml => ifv |
2013-09-23 10:22 |
|
Status | feedback => resolved |
2013-09-27 10:19 |
|
Note Added: 0025764 | |
2013-09-27 10:19 |
|
Status | resolved => reviewed |
2013-09-27 13:33 |
|
Test case number | => Not needed |
2013-09-27 13:33 |
|
Assigned To | ifv => mkv |
2013-09-30 15:48 |
|
Note Added: 0025795 | |
2013-09-30 15:48 |
|
Assigned To | mkv => bugmaster |
2013-09-30 15:48 |
|
Status | reviewed => tested |
2013-10-04 12:48 | bugmaster | Changeset attached | => occt master 3ed30348 |
2013-10-04 12:48 | bugmaster | Status | tested => verified |
2013-10-04 12:48 | bugmaster | Resolution | open => fixed |
2013-10-04 14:32 |
|
Note Added: 0025897 | |
2013-10-04 14:38 |
|
Assigned To | bugmaster => aml |
2013-10-04 14:39 |
|
Note Added: 0025898 | |
2013-10-04 14:39 |
|
Status | verified => feedback |
2013-10-04 14:39 |
|
Resolution | fixed => reopened |
2013-10-04 14:44 |
|
Note Added: 0025899 | |
2013-10-04 14:58 |
|
Note Added: 0025901 | |
2013-10-04 15:06 |
|
Relationship added | parent of 0024222 |
2013-10-04 15:16 |
|
Assigned To | aml => bugmaster |
2013-10-04 15:17 |
|
Note Added: 0025904 | |
2013-10-04 15:37 | bugmaster | Status | feedback => tested |
2013-10-04 15:37 | bugmaster | Status | tested => verified |
2013-10-04 15:37 | bugmaster | Resolution | reopened => fixed |
2013-12-19 13:51 | bugmaster | Status | verified => closed |
2013-12-19 13:58 | bugmaster | Fixed in Version | => 6.7.0 |