Archived issue #0024275

Cppcheck warnings on uninitialized class members

Open CASCADEOCCT:Codingclosed9 public notes

Search issues

Description

Cppcheck reports about 350 warnings on uninitialized class members in current OCCT master. See attached log for details. Providing good default initializes for these members could protect against possible use of uninitialized values which cannot be controlled by compiler.

Public activity

9 archived notes

Participants are labeled by their role within this record.

01Commenter 1
Most part of cppcheck warings were removed.
Changes are located in branch CR24275.
Please, review.
02Commenter 2
No remarks, please check
03Commenter 3
Dear Commenter 1,

Branch CR24275 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 323 (323 on master)
Windows: 13 (0 on master)

New additional compilation warnings on Windows platform:
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/job/mnt-CR24275-master_build_occt_windows/1/warnings28Result/?

OSD_Path.cxx:1047, MSBuild, Priority: High
'whereAmI': identifier not found

OSD_Path.cxx:1114, MSBuild, Priority: High
'whereAmI': identifier not found

products component :
Linux: 189 (189 on master)
Windows: 287 (287 on master)
04Commenter 4
No remarks, please test
05Commenter 5
Dear Commenter 1,

Branch CR24275 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 337 (323 on master)
Windows: 0 (0 on master)

15 additional warnings on Linux platform:

GNU Compiler Warnings - Source Folder ../../../../inc
http://jenkins-test-02.nnov.opencascade.com:8080/user/mnt/my-views/view/A_mnt_warnings/job/mnt-CR24275-master_build_occt_linux/1/warnings15Result/package.-671474530/

Double warning
BOPCol_Array1.hxx:187

BRepGProp_Face.hxx:161, GNU Compiler 4 (gcc), Priority: Normal
‘Standard_Boolean BRepGProp_Face::mySReverse’

BRepGProp_Face.hxx:162, GNU Compiler 4 (gcc), Priority: Normal
‘BRepGProp_Face::myIsUseSpan’ will be initialized after

BRepGProp_Face.lxx:29, GNU Compiler 4 (gcc), Priority: Normal
when initialized here

Graphic3d_CGraduatedTrihedron.hxx:37, GNU Compiler 4 (gcc), Priority: Normal
when initialized here

Graphic3d_CGraduatedTrihedron.hxx:65, GNU Compiler 4 (gcc), Priority: Normal
‘Standard_Boolean Graphic3d_CGraduatedTrihedron::xdrawname’

Graphic3d_CGraduatedTrihedron.hxx:103, GNU Compiler 4 (gcc), Priority: Normal
‘Graphic3d_CGraduatedTrihedron::ptrVisual3dView’ will be initialized after

Double warning
NCollection_DataMap.hxx:183

Double warning
NCollection_IndexedDataMap.hxx:236

Double warning
NCollection_IndexedMap.hxx:228

Double warning
NCollection_Map.hxx:187

Double warning
NCollection_Map.hxx:213

Double warning
TCollection_Array2.gxx:127


products component :
Linux: 189 (189 on master)
Windows: 287 (287 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 356047620 / 356295124
Total CPU difference: 43411.47000000095 / 40672.21000000072

Testing on Windows:
Total MEMORY difference: 407437496 / 406499704
Total CPU difference: 29393.828125 / 34773.5

There are not differences in images found by testdiff.
06Commenter 6
No remarks, please test
07Commenter 7
Dear abv,
could you please rebase CR24275 to current master, there are conflict files.
08Commenter 8
Branch CR24275 was rebased to current master.

09Commenter 9
Dear Commenter 1,

Branch CR24275 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
[revision removed]

Number of compiler warnings:

occt component :
Linux: 318 (318 on master)
Windows: 0 (0 on master)

products component :
Linux: 188 (188 on master)
Windows: 287 (287 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 356362408 / 356493764
Total CPU difference: 42206.56000000061 / 42449.46000000157

Testing on Windows:
Total MEMORY difference: 411727832 / 410787992
Total CPU difference: 31485.609375 / 30177.328125

There are not differences in images found by testdiff.