View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0029151 | Open CASCADE | OCCT:Coding | public | 2017-09-28 10:24 | 2018-06-29 21:19 |
Reporter | Assigned To | ||||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Target Version | 7.3.0 | Fixed in Version | 7.3.0 | ||
Summary | 0029151: Coding Rules - eliminate GCC compiler warnings -Wimplicit-fallthrough | ||||
Description | When building OCCT with GCC 7.1 compiler (MinGW-64), it generates ~ 120 warnings on switch "case" blocks not ended by break or return or similar statement and passing control through to the next case block. | ||||
Steps To Reproduce | Build with GCC 7 | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
parent of | 0029157 | closed | bugmaster | Modeling - suspicious pass-through of case labels in switch statements |
parent of | 0029158 | closed | bugmaster | Visualization - suspicious pass-through of case labels in switch statements |
related to | 0029152 | closed | bugmaster | Coding Rules - eliminate GCC compiler warnings -Wmisleading-indentation when using MinGW |
|
Branch CR29151 has been created by abv. SHA-1: 0587c3eec451fe46af7839283b32ca9f4a5c1b4b Detailed log of new commits: Author: abv Date: Thu Sep 28 10:26:47 2017 +0300 0029151: GCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=] In places where case block of switch passes control to other case intentionally, comment is added for GCC to recognize this as intentional and not issue a warning message. |
|
Branch CR29151 has been updated by kgv. SHA-1: 6946692c9341c54353d10e29a07c4d0aa3089761 Detailed log of new commits: Author: kgv Date: Thu Sep 28 21:29:22 2017 +0300 Added Standard_FALLTHROUGH macros. |
|
Branch CR29151_1 has been created by abv. SHA-1: ab542f6560302ea7f4b80ce906e8a23027440ef4 Detailed log of new commits: Author: abv Date: Thu Sep 28 10:26:47 2017 +0300 0029151: GCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=] New macro Standard_FALLTHROUGH is defined for use in a switch statement immediately before a case label, if code associated with the previous case label may fall through to that next label (i.e. does not end with "break" or "return" etc.). This macro indicates that the fall through is intentional and should not be diagnosed by a compiler that warns on fallthrough. The macro is inserted in places that currently generate such warning message and where fallthrough is intentional. Doxygen comments are provided for this and other macros in Standard_Macro.hxx. |
|
Fix is pushed to CR29151_1, please review |
|
Branch CR29151_1 has been updated forcibly by abv. SHA-1: cc710a7df081ea38b855d44cf0e76e9441c64609 |
|
Tested in framework of testing issue 29170 |
|
src/Extrema/Extrema_ExtCS.cxx - 132: This is strange code, and I think 'break' is needed here. Indeed, mtExtElCS computed line-plane case, so why it is passed to the general case? I propose to insert break and run the tests. src/IGESDraw/IGESDraw_GeneralModule.cxx - 181: mistake, break is needed here. Remove info about conflicts from the commit message. |
|
On src/Extrema/Extrema_ExtCS.cxx: I have consulted with AML and he explained that extrema of line vs. plane is not fully implemented and will not give any useful result (except for analysis of parallel case). This means that fallthrough is correct. On src/IGESDraw/IGESDraw_GeneralModule.cxx: I agree, thank you for noting that! |
|
I have created the bug 0029178 to solve the issue with line-plane extrema. |
|
Branch CR29151_2 has been created by abv. SHA-1: b1811c1d2b78aab36e2e75d0a2191cc768e9c232 Detailed log of new commits: Author: abv Date: Thu Sep 28 10:26:47 2017 +0300 0029151: GCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=] New macro Standard_FALLTHROUGH is defined for use in a switch statement immediately before a case label, if code associated with the previous case label may fall through to that next label (i.e. does not end with "break" or "return" etc.). This macro indicates that the fall through is intentional and should not be diagnosed by a compiler that warns on fallthrough. The macro is inserted in places that currently generate such warning message and where fallthrough is intentional. Doxygen comments are provided for this and other macros in Standard_Macro.hxx. |
|
Please integrate corrected version in branch CR29151_2; tests have passed with no diffs - see last run of Jenkins job CR29151-master-abv |
|
Tested in scope 29170 |
|
Branch CR29151 has been deleted by kgv. SHA-1: 6946692c9341c54353d10e29a07c4d0aa3089761 |
|
Branch CR29151_1 has been deleted by kgv. SHA-1: cc710a7df081ea38b855d44cf0e76e9441c64609 |
|
Branch CR29151_2 has been deleted by kgv. SHA-1: b1811c1d2b78aab36e2e75d0a2191cc768e9c232 |
occt: master b1811c1d 2017-09-28 07:26:47
Committer: abv Details Diff |
0029151: GCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=] New macro Standard_FALLTHROUGH is defined for use in a switch statement immediately before a case label, if code associated with the previous case label may fall through to that next label (i.e. does not end with "break" or "return" etc.). This macro indicates that the fall through is intentional and should not be diagnosed by a compiler that warns on fallthrough. The macro is inserted in places that currently generate such warning message and where fallthrough is intentional. Doxygen comments are provided for this and other macros in Standard_Macro.hxx. |
Affected Issues 0029151 |
|
mod - src/APIHeaderSection/APIHeaderSection_EditHeader.cxx | Diff File | ||
mod - src/Approx/Approx_CurvlinFunc.cxx | Diff File | ||
mod - src/BndLib/BndLib.cxx | Diff File | ||
mod - src/BndLib/BndLib_AddSurface.cxx | Diff File | ||
mod - src/BRepLib/BRepLib_FindSurface.cxx | Diff File | ||
mod - src/BRepTest/BRepTest_CheckCommands.cxx | Diff File | ||
mod - src/Extrema/Extrema_ExtCS.cxx | Diff File | ||
mod - src/GeometryTest/GeometryTest_ContinuityCommands.cxx | Diff File | ||
mod - src/GeomLib/GeomLib.cxx | Diff File | ||
mod - src/IFSelect/IFSelect_SessionPilot.cxx | Diff File | ||
mod - src/IGESConvGeom/IGESConvGeom.cxx | Diff File | ||
mod - src/IGESDraw/IGESDraw_GeneralModule.cxx | Diff File | ||
mod - src/IGESDraw/IGESDraw_ToolDrawing.cxx | Diff File | ||
mod - src/IGESToBRep/IGESToBRep_TopoSurface.cxx | Diff File | ||
mod - src/IntPatch/IntPatch_ALineToWLine.cxx | Diff File | ||
mod - src/IntPatch/IntPatch_ImpPrmIntersection.cxx | Diff File | ||
mod - src/IntPatch/IntPatch_Intersection.cxx | Diff File | ||
mod - src/Intrv/Intrv_Intervals.cxx | Diff File | ||
mod - src/IntTools/IntTools_EdgeEdge.cxx | Diff File | ||
mod - src/LDOM/LDOMBasicString.cxx | Diff File | ||
mod - src/LDOM/LDOMParser.cxx | Diff File | ||
mod - src/LDOM/LDOMString.cxx | Diff File | ||
mod - src/LDOM/LDOM_XmlReader.cxx | Diff File | ||
mod - src/Message/Message_MsgFile.cxx | Diff File | ||
mod - src/NCollection/NCollection_UtfIterator.lxx | Diff File | ||
mod - src/OpenGl/OpenGl_AspectMarker.cxx | Diff File | ||
mod - src/ProjLib/ProjLib_ProjectOnPlane.cxx | Diff File | ||
mod - src/SelectMgr/SelectMgr_SelectionManager.cxx | Diff File | ||
mod - src/Standard/Standard_Macro.hxx | Diff File | ||
mod - src/STEPControl/STEPControl_ActorWrite.cxx | Diff File | ||
mod - src/TDataXtd/TDataXtd_Geometry.cxx | Diff File | ||
mod - src/TNaming/TNaming_Name.cxx | Diff File | ||
mod - src/UnitsAPI/UnitsAPI.cxx | Diff File | ||
mod - src/ViewerTest/ViewerTest_AutoUpdater.cxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-09-28 10:24 |
|
New Issue | |
2017-09-28 10:24 |
|
Assigned To | => kgv |
2017-09-28 10:26 | git | Note Added: 0070933 | |
2017-09-28 13:04 | kgv | Relationship added | related to 0029152 |
2017-09-28 21:51 | kgv | Summary | GCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=] => Coding Rules - eliminate GCC compiler warnings -Wimplicit-fallthrough |
2017-09-28 22:43 | git | Note Added: 0070949 | |
2017-09-29 09:17 |
|
Relationship added | parent of 0029157 |
2017-09-29 09:20 |
|
Relationship added | parent of 0029158 |
2017-09-29 09:22 |
|
Description Updated | |
2017-09-29 10:01 | git | Note Added: 0070953 | |
2017-09-29 10:01 |
|
Note Added: 0070954 | |
2017-09-29 10:01 |
|
Assigned To | kgv => msv |
2017-09-29 10:01 |
|
Status | new => resolved |
2017-09-29 10:01 |
|
Steps to Reproduce Updated | |
2017-09-29 11:27 | kgv | Description Updated | |
2017-09-29 20:18 | git | Note Added: 0071078 | |
2017-10-03 09:39 | bugmaster | Assigned To | msv => bugmaster |
2017-10-03 09:39 | bugmaster | Status | resolved => reviewed |
2017-10-03 09:40 | bugmaster | Note Added: 0071133 | |
2017-10-03 09:40 | bugmaster | Status | reviewed => tested |
2017-10-03 09:52 | bugmaster | Test case number | => Not required |
2017-10-03 12:53 |
|
Note Added: 0071149 | |
2017-10-03 12:53 |
|
Assigned To | bugmaster => abv |
2017-10-03 12:53 |
|
Status | tested => assigned |
2017-10-03 15:11 |
|
Note Added: 0071158 | |
2017-10-03 16:18 |
|
Note Added: 0071160 | |
2017-10-04 15:28 | git | Note Added: 0071197 | |
2017-10-04 23:02 |
|
Note Added: 0071221 | |
2017-10-04 23:02 |
|
Assigned To | abv => kgv |
2017-10-04 23:02 |
|
Status | assigned => resolved |
2017-10-04 23:02 |
|
Assigned To | kgv => bugmaster |
2017-10-04 23:02 |
|
Status | resolved => reviewed |
2017-10-05 13:20 | bugmaster | Note Added: 0071234 | |
2017-10-05 13:20 | bugmaster | Status | reviewed => tested |
2017-10-06 14:55 |
|
Changeset attached | => occt master b1811c1d |
2017-10-06 14:55 |
|
Assigned To | bugmaster => abv |
2017-10-06 14:55 |
|
Status | tested => verified |
2017-10-06 14:55 |
|
Resolution | open => fixed |
2017-10-14 12:19 | git | Note Added: 0071464 | |
2017-10-14 12:19 | git | Note Added: 0071465 | |
2017-10-14 12:20 | git | Note Added: 0071466 | |
2018-06-29 21:15 |
|
Fixed in Version | => 7.3.0 |
2018-06-29 21:19 |
|
Status | verified => closed |