View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0029164 | Open CASCADE | OCCT:Coding | public | 2017-09-29 18:17 | 2018-06-29 21:19 |
Reporter | Assigned To | bugmaster | |||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Target Version | 7.3.0 | Fixed in Version | 7.3.0 | ||
Summary | 0029164: GCC 7.1 compiler warnings -Wmaybe-uninitialized on gp_XYZ and siblings | ||||
Description | When OCCT is built with GCC 7.1 compiler (MinGw-64) it reports several warnings -Wmaybe-uninitialized in gp_XYZ and sibling classes. While location of the problem is not properly reported by compiler, the reason is recognized: this is due to usage of local variables of reference type pointing to field of temporray object, like this: Handle(Geom_Line) aLine = ...; const gp_Dir& aDir = aLine->Lin().Direction(); Here Geom_Line::Lin() returns temporary object, and Direction() returns reference to its field. The object gets destroyed immediately (compiler has no knowledge of the fact that the value returned by Direction() is reference to field of that object). Thus aDir points to memory where destroyed object was located and which can be easily corrupted. | ||||
Steps To Reproduce | Build with GCC 7.1 (MinGW-64) | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
|
Branch CR29164 has been created by abv. SHA-1: 882dbc8cb1d8bbe1841467097457c9e243423c5f Detailed log of new commits: Author: abv Date: Fri Sep 29 18:35:03 2017 +0300 0029164: GCC 7.1 compiler warnings -Wmaybe-uninitialized in gp_XYZ and siblings Code is corrected to avoid local variables of reference type pointing to fields of temporary objects. Author: kgv Date: Thu Sep 28 21:29:22 2017 +0300 0029152: Coding Rules - eliminate GCC compiler warnings -Wmisleading-indentation when using MinGW |
|
Branch CR29164 has been updated forcibly by abv. SHA-1: e8701df9e5b08da1fa0eb02b939b976422ecba99 |
|
Branch CR29164 has been updated forcibly by abv. SHA-1: 72886751fde0a0aae0f1117a24d75d165ff369a2 |
|
Branch CR29164 has been updated forcibly by abv. SHA-1: 4e05f0aade0786ae27b8810747398b6015b60d0c |
|
Fix is pushed to CR29164, please review |
|
Please test the patch. |
|
Tested in framework of testing issue 29170 |
|
Branch CR29164 has been deleted by kgv. SHA-1: 4e05f0aade0786ae27b8810747398b6015b60d0c |
occt: master 9b372aa8 2017-09-29 15:35:03
Committer: bugmaster Details Diff |
0029164: GCC 7.1 compiler warnings -Wmaybe-uninitialized in gp_XYZ and siblings Code is corrected to avoid local variables of reference type pointing to fields of temporary objects. |
Affected Issues 0029164 |
|
mod - src/AIS/AIS_EqualDistanceRelation.cxx | Diff File | ||
mod - src/BRepClass3d/BRepClass3d_SClassifier.cxx | Diff File | ||
mod - src/DrawDim/DrawDim_Distance.cxx | Diff File | ||
mod - src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx | Diff File | ||
mod - src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-09-29 18:17 |
|
New Issue | |
2017-09-29 18:17 |
|
Assigned To | => kgv |
2017-09-29 18:36 | git | Note Added: 0071073 | |
2017-09-29 18:56 | git | Note Added: 0071074 | |
2017-09-29 19:09 | git | Note Added: 0071076 | |
2017-09-29 20:19 | git | Note Added: 0071079 | |
2017-10-01 14:09 |
|
Note Added: 0071093 | |
2017-10-01 14:09 |
|
Steps to Reproduce Updated | |
2017-10-01 14:24 |
|
Status | new => resolved |
2017-10-01 16:23 | kgv | Note Added: 0071095 | |
2017-10-01 16:23 | kgv | Assigned To | kgv => bugmaster |
2017-10-01 16:23 | kgv | Status | resolved => reviewed |
2017-10-03 09:40 | bugmaster | Note Added: 0071134 | |
2017-10-03 09:40 | bugmaster | Status | reviewed => tested |
2017-10-03 09:52 | bugmaster | Test case number | => Not required |
2017-10-06 14:55 | bugmaster | Changeset attached | => occt master 9b372aa8 |
2017-10-06 14:55 | bugmaster | Status | tested => verified |
2017-10-06 14:55 | bugmaster | Resolution | open => fixed |
2017-10-14 12:20 | git | Note Added: 0071473 | |
2018-06-29 21:15 |
|
Fixed in Version | => 7.3.0 |
2018-06-29 21:19 |
|
Status | verified => closed |