Archived issue #0027643
Coding rules - eliminate GCC warning -Wmaybe-uninitialized
Description
The following warning appear when compiling current OCCT master:
on gcc compiler:
In file included from C:\occt\src\GCPnts\GCPnts_AbscissaPoint.cxx:39:0:
C:\occt\src\GCPnts\GCPnts_AbscissaPoint.pxx: In static member function 'static Standard_Real GCPnts_AbscissaPoint::Length(const Adaptor3d_Curve&, Standard_Real, Standard_Real)':
C:\occt\src\GCPnts\GCPnts_AbscissaPoint.pxx:320:25: warning: 'Ratio' may be used uninitialized in this function [-Wmaybe-uninitialized]
return Abs(U2-U1) * Ratio;
^
C:\occt\src\GCPnts\GCPnts_AbscissaPoint.pxx: In static member function 'static Standard_Real GCPnts_AbscissaPoint::Length(const Adaptor3d_Curve&, Standard_Real, Standard_Real, Standard_Real)':
C:\occt\src\GCPnts\GCPnts_AbscissaPoint.pxx:361:25: warning: 'Ratio' may be used uninitialized in this function [-Wmaybe-uninitialized]
return Abs(U2-U1) * Ratio;
^
C:\occt\src\GCPnts\GCPnts_AbscissaPoint.pxx: In function 'void AdvCompute(CPnts_AbscissaPoint&, const Adaptor3d_Curve&, Standard_Real&, Standard_Real&, Standard_Real&, Standard_Real)':
C:\occt\src\GCPnts\GCPnts_AbscissaPoint.pxx:175:42: warning: 'Ratio' may be used uninitialized in this function [-Wmaybe-uninitialized]
theComputer.SetParameter(U0 + Abscis / Ratio);
^
C:\occt\src\GeomFill\GeomFill_SectionPlacement.cxx: In member function 'void GeomFill_SectionPlacement::Perform(const opencascade::handle<Adaptor3d_HCurve>&, Standard_Real)':
C:\occt\src\GeomFill\GeomFill_SectionPlacement.cxx:669:19: warning: 'taux' may be used uninitialized in this function [-Wmaybe-uninitialized]
PathParam = taux;
^
on gcc compiler:
aarch64-linux-android-g++.exe (GCC) 4.9.x 20150123 (prerelease)
Public activity
5 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Author
Date: Sun Jun 26 20:10:35 2016 +0300
0027643: Coding rules - eliminate GCC warning -Wmaybe-uninitialized
[revision removed]
Detailed log of new commits:
Author: Author
Date: Sun Jun 26 20:10:35 2016 +0300
0027643: Coding rules - eliminate GCC warning -Wmaybe-uninitialized
Please test the patch.
Dear Commenter 1,
Branch CR27643 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)
products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1150
Regressions/Differences/Improvements:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
occt component :
Total MEMORY difference: 88588680 / 88709444 [-0.14%]
Total CPU difference: 19408.199999999866 / 19559.91999999992 [-0.78%]
products component :
Total MEMORY difference: 27450133 / 27390508 [+0.22%]
Total CPU difference: 5175.459999999996 / 5182.479999999985 [-0.14%]
Testing on Windows:
occt component :
Total MEMORY difference: 55889748 / 55895183 [-0.01%]
Total CPU difference: 18294.518071798844 / 17842.068371498677 [+2.54%]
products component :
Total MEMORY difference: 18612816 / 18577733 [+0.19%]
Total CPU difference: 5027.3194261999515 / 4930.286804199938 [+1.97%]
There are no differences in images found by testdiff.
Branch CR27643 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)
products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1150
Regressions/Differences/Improvements:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
occt component :
Total MEMORY difference: 88588680 / 88709444 [-0.14%]
Total CPU difference: 19408.199999999866 / 19559.91999999992 [-0.78%]
products component :
Total MEMORY difference: 27450133 / 27390508 [+0.22%]
Total CPU difference: 5175.459999999996 / 5182.479999999985 [-0.14%]
Testing on Windows:
occt component :
Total MEMORY difference: 55889748 / 55895183 [-0.01%]
Total CPU difference: 18294.518071798844 / 17842.068371498677 [+2.54%]
products component :
Total MEMORY difference: 18612816 / 18577733 [+0.19%]
Total CPU difference: 5027.3194261999515 / 4930.286804199938 [+1.97%]
There are no differences in images found by testdiff.
Dear Commenter 1,
Branch CR27643 is TESTED.
Branch CR27643 is TESTED.
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]