Archived issue #0029927

Coding Rules - eliminate GCC compiler warnings -Wmaybe-uninitialized in BRepApprox

Open CASCADEOCCT:Codingclosed5 public notes

Search issues

Description

The following GCC 7.3.0 compiler warnings should be eliminated:
                 from /occt/src/BRepApprox/BRepApprox_Approx_0.cxx:17:
/occt/inc/../src/gp/gp_Pnt.lxx: In member function ‘void BRepApprox_Approx::fillData(const opencascade::handle<BRepApprox_ApproxLine>&)’:
/occt/inc/../src/gp/gp_Pnt.lxx:64:18: warning: ‘<anonymous>’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 { return coord.X(); }
                  ^
/occt/inc/../src/gp/gp_Pnt.lxx:67:18: warning: ‘*((void*)&<anonymous> +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 { return coord.Y(); }
g++ -mmmx -msse -msse2 -mfpmath=sse -std=c++0x -fPIC -DOCC_CONVERT_SIGNALS -Wall -fexceptions -DHAVE_FREEIMAGE -DHAVE_FFMPEG -I/usr/include/tcl8.6 -I/usr/include/freetype2 -I/occt/inc -O2 -DNDEBUG -DNo_Exception -I../../../inc -c /occt/src/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox_0.cxx -o ../../../lin/cbp/obj/src/BRepApprox/BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox_0.o
                  ^
/occt/inc/../src/gp/gp_Pnt.lxx:70:18: warning: ‘*((void*)&<anonymous> +16)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 { return coord.Z(); }
...

                 from /occt/src/BRepApprox/BRepApprox_TheMultiLineOfApprox_0.cxx:17:
/occt/inc/../src/gp/gp_Pnt.lxx: In member function ‘void BRepApprox_TheMultiLineOfApprox::Value(Standard_Integer, TColgp_Array1OfPnt&) const’:
/occt/inc/../src/gp/gp_Pnt.lxx:70:18: warning: ‘*((void*)&<anonymous> +16)’ is used uninitialized in this function [-Wuninitialized]
 { return coord.Z(); }
                  ^
/occt/inc/../src/gp/gp_Pnt.lxx:67:18: warning: ‘*((void*)&<anonymous> +8)’ is used uninitialized in this function [-Wuninitialized]
 { return coord.Y(); }
                  ^
/occt/inc/../src/gp/gp_Pnt.lxx:64:18: warning: ‘<anonymous>’ is used uninitialized in this function [-Wuninitialized]
 { return coord.X(); }
                  ^

Steps to reproduce

N/A

Public activity

5 archived notes

Participants are labeled by their role within this record.

01Commenter 3
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Wed Jul 4 10:49:44 2018 +0300

    0029927: Coding Rules - eliminate GCC compiler warnings -Wmaybe-uninitialized in BRepApprox
    
    Fixed taking a reference from a field of a temporary variable
    (BRepApprox_ApproxLine::Point() returns non-reference structure).
02Author
03Commenter 3
No remarks, please integrate
04Commenter 1
Combination -
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 17120.719999999914 / 17168.50999999987 [-0.28%]
Products
Total CPU difference: 7457.720000000031 / 7526.93000000002 [-0.92%]
Windows-64-VC10:
OCCT
Total CPU difference: 16885.064636898547 / 16935.000556998602 [-0.29%]
Products
Total CPU difference: 8230.877961699889 / 8215.262261599859 [+0.19%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
05Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records