View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0023132 | Community | OCCT:Foundation Classes | public | 2012-05-04 01:41 | 2013-04-29 15:21 |
Reporter | QbProg | Assigned To | |||
Priority | normal | Severity | tweak | ||
Status | closed | Resolution | fixed | ||
Platform | Windows | OS | VC++ 2010 | ||
Product Version | 6.5.3 | ||||
Target Version | 6.6.0 | Fixed in Version | 6.6.0 | ||
Summary | 0023132: Suspicious code snippets | ||||
Description | I'm sending you a bunch of suspicios lines found some time ago while removing warnings. I didn't know the 100% proper fix, maybe you could take a look. Probably the "dead code" ones are intended, and the code was left there unused. --- src\Aspect\Aspect.cxx , line 116 "cast truncates constant value" warning. Changing to 0xFEE0u is warning-clean, but I don't know if it works. -- if you search all around the code RWStepBasic for the string ent->Init(hasAprefix,aPrefix,aName); you will see that in all these functions, in case of error, the failure message is added, but the values are used anyway. In case of error the used variables have an undefined value. -- TopOpeBRepTool\TopOpeBRepTool_mkTondgE.cxx , line 367 the return statement makes the remaining code in the scope never executed. Is this intended? --- GeomFill\GeomFill_LocationGuide.cxx, line 745 the return statement makes the whole scope dead code. Is this intended? ---- src\IntTools\IntTools_EdgeFace.cxx Line 901 : you see there's a return 0 in a scope, that makes the remaining of the function dead code. Is it intended? --------- src\BRepFill\BRepFill_OffsetWire.cxx , line 622 if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) && ( Abs(f-l) >= M_PI) ) { return 0; // the return makes the remaining scope dead code. Is it intended? -------- src\TopOpeBRep\TopOpeBRep_ShapeIntersector2d.cxx , line 281 the NextFFCouple() line is never executed --- src\V2d\V2d_RectangularGraphicGrid.cxx , line 71 alpha = Standard_ShortReal ( alpha - 1.57/2.0 ); that is probably PI / 4 and in the line above the two 1.57 are just PI / 2 maybe the 1.41 is sqrt(2) ? --- src\IFSelect\IFSelect_WorkSession.cxx , line 2825 thecheckana = TCollection_AsciiString (' ',nb+1); probably the constructor parameters are reversed, should be nb+1,' ' --- | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
parent of | 0023140 | closed | Suspicious if | |
parent of | 0023141 | closed | Suspicious if (2) | |
parent of | 0023142 | closed | ika | GccAna : suspicious else |
parent of | 0023143 | closed | Suspicious else | |
parent of | 0023144 | closed | Suspicious if (3) | |
parent of | 0023145 | closed | ika | Suspicious else (2) |
parent of | 0023146 | closed | bugmaster | Suspicious if (4) |
parent of | 0023147 | closed | Suspicious if (5) | |
parent of | 0023288 | closed | IntCurve_IntConicConic_1.cxx: if(A) {...} else if (A){...} pattern detected | |
parent of | 0023289 | closed | IntCurve_IntPolyPolyGen.gxx, suspicious else | |
parent of | 0023290 | closed | ika | IntCurve_IntPolyPolyGen.gxx, suspicious if/for |
parent of | 0023291 | closed | ika | GccAna_Circ2d3Tan_8.cxx, suspicious if |
parent of | 0023293 | closed | boptools_tools2d.cxx 333 suspicious if/else | |
parent of | 0023309 | closed | The 'then' statement is equivalent to the 'else' statement in TopOpeBRep_EdgesFiller.cxx | |
parent of | 0023312 | closed | Suspicious for loop in BiTgte_Blend.cxx |
|
I suggest we create separate issues (children of this one) per problem type / OCCT module, to simplify code review. |
|
should I do that? how can I create a "child" issue? or the relationship is assigned after the creation? |
|
QbProg: I hope Dmitry will create child issues, though if you wish you can do this as well. The relationships between issues are set after the issues are created (see block 'Relationships'). |
|
I cannot set the relashionships, probably I don't have the rights. I have added other issues related to this one, you may want to set these related to this one too. |
|
Dear OAN, Fix is is integrated into branch CR23132. Please, review. |
|
Dear JGV, please review the changes. |
|
No remarks |
|
Dear BugMaster, Branch CR23132(and products from GIT master) was compiled on Linux and Windows platforms and tested. Regression: boolean bfuse_complex Q8 Q9 caf named_shape E8 caf driver A8 Improvements: Not detected Testing case: Not needed |
|
Dear apn, I've fixed the mistake that led to fails in test cases, that you mentioned. Please, test. |
|
Dear BugMaster, Branch CR23132 (and products from occt GIT master) was compiled on Linux and Windows platforms and tested. Regressions: Not detected Improvements: Not detected Testing cases: Not needed |
|
Dear BugMaster, Branch CR23132 (and products from occt GIT master) was compiled on Linux and Windows platforms and retested. Regressions: Not detected Improvements: Not detected Testing cases: Not needed |
occt: master 4e76d93b 2012-11-16 09:30:31
|
0023132: Suspicious code snippets 1) Warning in Aspect.cxx couldn't be reproduced 2) Description of changes: added 'return' statements into ReadStep(...) functions of RWStepBasic_* classes. 3) BRepFill_OffsetWire.cxx - removed dead code; 4) IFSelect_WorkSession.cxx - swapped arguments; 5) TopOpeBRep_ShapeIntersector2d.cxx - removed 'brake' statement and changed loop to if-statement because of void TopOpeBRep_ShapeIntersector2d::FindFFIntersection() function's call features. 6) V2d_RectangularGraphicGrid.cxx - left constants instead of functions beacuse of faster perfomance. 7) Commented unreachable code in files GeomFill_LocationGuide.cxx and TopOpeBRepTool_mkTondgE.cxx |
Affected Issues 0023132 |
|
mod - src/BRepFill/BRepFill_OffsetWire.cxx | Diff File | ||
mod - src/GeomFill/GeomFill_LocationGuide.cxx | Diff File | ||
mod - src/IFSelect/IFSelect_WorkSession.cxx | Diff File | ||
mod - src/IntTools/IntTools_EdgeFace.cxx | Diff File | ||
mod - src/RWStepBasic/RWStepBasic_RWSiUnitAndAreaUnit.cxx | Diff File | ||
mod - src/RWStepBasic/RWStepBasic_RWSiUnitAndLengthUnit.cxx | Diff File | ||
mod - src/RWStepBasic/RWStepBasic_RWSiUnitAndMassUnit.cxx | Diff File | ||
mod - src/RWStepBasic/RWStepBasic_RWSiUnitAndPlaneAngleUnit.cxx | Diff File | ||
mod - src/RWStepBasic/RWStepBasic_RWSiUnitAndRatioUnit.cxx | Diff File | ||
mod - src/RWStepBasic/RWStepBasic_RWSiUnitAndSolidAngleUnit.cxx | Diff File | ||
mod - src/RWStepBasic/RWStepBasic_RWSiUnitAndThermodynamicTemperatureUnit.cxx | Diff File | ||
mod - src/RWStepBasic/RWStepBasic_RWSiUnitAndTimeUnit.cxx | Diff File | ||
mod - src/RWStepBasic/RWStepBasic_RWSiUnitAndVolumeUnit.cxx | Diff File | ||
mod - src/TopOpeBRep/TopOpeBRep_ShapeIntersector2d.cxx | Diff File | ||
mod - src/TopOpeBRepTool/TopOpeBRepTool_mkTondgE.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-05-04 01:41 | QbProg | New Issue | |
2012-05-04 01:41 | QbProg | Assigned To | => abv |
2012-05-04 12:53 |
|
Note Added: 0020473 | |
2012-05-04 12:53 |
|
Assigned To | abv => dbv |
2012-05-04 12:53 |
|
Status | new => assigned |
2012-05-04 15:57 | QbProg | Note Added: 0020478 | |
2012-05-04 16:02 |
|
Note Added: 0020480 | |
2012-05-06 19:59 | QbProg | Note Added: 0020489 | |
2012-05-07 09:16 |
|
Relationship added | parent of 0023140 |
2012-05-07 09:16 |
|
Relationship added | parent of 0023141 |
2012-05-07 09:17 |
|
Relationship added | parent of 0023142 |
2012-05-07 09:18 |
|
Relationship added | parent of 0023143 |
2012-05-07 09:18 |
|
Relationship added | parent of 0023144 |
2012-05-07 09:18 |
|
Relationship added | parent of 0023145 |
2012-05-07 09:19 |
|
Relationship added | parent of 0023146 |
2012-05-07 09:19 |
|
Relationship added | parent of 0023147 |
2012-05-07 09:21 |
|
Product Version | => 6.5.3 |
2012-05-07 09:21 |
|
Target Version | => 6.5.4 |
2012-07-16 16:17 | Pawel | Relationship added | parent of 0023288 |
2012-07-16 16:25 | Pawel | Relationship added | parent of 0023289 |
2012-07-16 16:29 | Pawel | Relationship added | parent of 0023290 |
2012-07-16 16:57 | Pawel | Relationship added | parent of 0023291 |
2012-07-17 12:56 | Pawel | Relationship added | parent of 0023293 |
2012-07-17 18:02 | Pawel | Relationship added | parent of 0023309 |
2012-07-17 19:12 | Pawel | Relationship added | parent of 0023312 |
2012-10-09 19:01 | oan | Assigned To | dbv => omy |
2012-10-19 15:17 |
|
Note Added: 0021853 | |
2012-10-19 15:17 |
|
Assigned To | omy => oan |
2012-10-19 15:17 |
|
Status | assigned => resolved |
2012-10-22 11:07 | oan | Assigned To | oan => jgv |
2012-10-22 11:09 | oan | Note Added: 0021873 | |
2012-10-23 16:39 |
|
Note Added: 0021908 | |
2012-10-23 16:39 |
|
Status | resolved => reviewed |
2012-10-23 16:46 |
|
Assigned To | jgv => mkv |
2012-10-23 18:41 |
|
Target Version | 6.5.4 => 6.6.0 |
2012-10-31 18:56 | apn | Note Added: 0022039 | |
2012-10-31 18:56 | apn | Test case number | => Not needed |
2012-10-31 18:56 | apn | Assigned To | mkv => omy |
2012-10-31 18:56 | apn | Status | reviewed => assigned |
2012-11-08 13:18 |
|
Note Added: 0022145 | |
2012-11-08 13:18 |
|
Assigned To | omy => apn |
2012-11-08 13:18 |
|
Status | assigned => resolved |
2012-11-08 13:26 |
|
Status | resolved => reviewed |
2012-11-08 18:22 |
|
Assigned To | apn => mkv |
2012-11-09 14:37 |
|
Note Added: 0022179 | |
2012-11-09 14:38 |
|
Assigned To | mkv => bugmaster |
2012-11-09 14:38 |
|
Status | reviewed => tested |
2012-11-21 14:39 |
|
Note Edited: 0022179 | |
2012-11-22 11:51 |
|
Note Added: 0022350 | |
2012-11-26 15:45 |
|
Changeset attached | => occt master 4e76d93b |
2012-11-26 15:45 |
|
Assigned To | bugmaster => omy |
2012-11-26 15:45 |
|
Status | tested => verified |
2012-11-26 15:45 |
|
Resolution | open => fixed |
2012-12-10 17:16 |
|
Changeset attached | => occt master 4e76d93b |
2013-04-23 13:37 |
|
Status | verified => closed |
2013-04-29 15:21 |
|
Fixed in Version | => 6.6.0 |