View Issue Details

IDProjectCategoryView StatusLast Update
0024209Open CASCADEOCCT:Codingpublic2014-05-05 13:37
ReporterabvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.7.0 
Target Version6.7.1Fixed in Version6.7.1 
Summary0024209: Cppcheck errors "unusedScopedObject"
DescriptionCppcheck 1.61 (executed with option -DWNT on OCCT master at 6e5fec15) reports error "unusedScopedObject" at the following locations:

[src\Extrema\Extrema_GenExtCS.cxx:311]: (error) Instance of 'math_FunctionSetRoot' object is destroyed immediately.
[src\MeshTest\MeshTest.cxx:1244]: (error) Instance of 'BRepMesh_IncrementalMesh' object is destroyed immediately.
[src\Poly\Poly_CoherentTriangulation.cxx:593]: (error) Instance of 'Standard_ProgramError' object is destroyed immediately.
[src\Poly\Poly_CoherentTriangulation.cxx:668]: (error) Instance of 'Standard_ProgramError' object is destroyed immediately.
[src\QABugs\QABugs_19.cxx:129]: (error) Instance of 'BRepAlgo_Cut' object is destroyed immediately.
[src\StdSelect\StdSelect_BRepSelectionTool.cxx:88]: (error) Instance of 'BRepMesh_IncrementalMesh' object is destroyed immediately.
[src\TestTopOpe\TestTopOpe_HDSCommands.cxx:213]: (error) Instance of 'Standard_Failure' object is destroyed immediately.

Though many of them seem to be false positives, some indicate errors like absence of call to Raise() in exception throwing. False positives can be eliminated by rearranging code (when reasonable) or by adding suppression in comment before the offending code line (// cppcheck-suppress unusedScopedObject).
TagsNo tags attached.
Test case numberNot needed

Activities

omy

2013-12-19 14:41

developer   ~0027267

Dear abv,
the fix has been integrated in branch CR24209.
Please, review.

kgv

2013-12-19 16:02

developer   ~0027270

Dear omy,

-    BRepMesh_IncrementalMesh(theShape, theDeflection, Standard_False, theDeviationAngle);
+    BRepMesh_IncrementalMesh aMesher(theShape, theDeflection, Standard_False, theDeviationAngle);
+    aMesher.Perform();

please pay attention on constructor description - Perform() will be called twice!

omy

2013-12-24 10:16

developer   ~0027312

Dear abv,
Please review the branch CR24209_1.

abv

2014-01-04 10:13

manager   ~0027386

No remarks, please test

mkv

2014-01-09 11:31

tester   ~0027412

Dear BugMaster,

Branch CR24209_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: b280ed9580581dc6b719362ccd47889e9ecaf5e2

Number of compiler warnings:

occt component :
Linux: 104 (104 on master)
Windows: 1 (1 on master)

products component :
Linux: 21 (21 on master)
Windows: 2 (2 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 356975172 / 358413724
Total CPU difference: 44009.570000000225 / 42225.33000000005

Testing on Windows:
Total MEMORY difference: 413885388 / 412810244
Total CPU difference: 27774.953125 / 31505.90625

There are not differences in images found by testdiff.

Related Changesets

occt: master b3a7aa39

2013-12-24 06:13:13

omy


Committer: bugmaster Details Diff
0024209: Cppcheck errors "unusedScopedObject"
Fixed bug with temporary objects.
Affected Issues
0024209
mod - src/Extrema/Extrema_GenExtCS.cxx Diff File
mod - src/MeshTest/MeshTest.cxx Diff File
mod - src/Poly/Poly_CoherentTriangulation.cxx Diff File
mod - src/QABugs/QABugs_19.cxx Diff File
mod - src/StdSelect/StdSelect_BRepSelectionTool.cxx Diff File
mod - src/TestTopOpe/TestTopOpe_HDSCommands.cxx Diff File

Issue History

Date Modified Username Field Change
2013-09-29 16:42 abv New Issue
2013-09-29 16:42 abv Assigned To => bugmaster
2013-10-15 20:39 abv Assigned To bugmaster => rkv
2013-10-15 20:39 abv Status new => assigned
2013-12-19 10:56 abv Assigned To rkv => omy
2013-12-19 10:56 abv Target Version 6.7.0 => 6.7.1
2013-12-19 14:41 omy Note Added: 0027267
2013-12-19 14:41 omy Status assigned => resolved
2013-12-19 16:02 kgv Note Added: 0027270
2013-12-19 16:02 kgv Status resolved => assigned
2013-12-24 10:16 omy Note Added: 0027312
2013-12-24 10:16 omy Assigned To omy => abv
2013-12-24 10:16 omy Status assigned => resolved
2014-01-04 10:13 abv Note Added: 0027386
2014-01-04 10:13 abv Assigned To abv => bugmaster
2014-01-04 10:13 abv Status resolved => reviewed
2014-01-08 11:29 mkv Assigned To bugmaster => mkv
2014-01-09 11:31 mkv Note Added: 0027412
2014-01-09 11:31 mkv Test case number => Not needed
2014-01-09 11:31 mkv Assigned To mkv => bugmaster
2014-01-09 11:31 mkv Status reviewed => tested
2014-01-11 11:58 abv Category OCCT Release:BUILD => OCCT:Coding
2014-01-13 10:43 bugmaster Changeset attached => occt master b3a7aa39
2014-01-13 10:43 bugmaster Status tested => verified
2014-01-13 10:43 bugmaster Resolution open => fixed
2014-05-05 13:36 aiv Status verified => closed
2014-05-05 13:37 aiv Fixed in Version => 6.7.1