View Issue Details

IDProjectCategoryView StatusLast Update
0029151Open CASCADEOCCT:Codingpublic2018-06-29 21:19
ReporterabvAssigned Toabv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.3.0Fixed in Version7.3.0 
Summary0029151: Coding Rules - eliminate GCC compiler warnings -Wimplicit-fallthrough
DescriptionWhen 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 ReproduceBuild with GCC 7
TagsNo tags attached.
Test case numberNot required

Relationships

parent of 0029157 closedbugmaster Modeling - suspicious pass-through of case labels in switch statements 
parent of 0029158 closedbugmaster Visualization - suspicious pass-through of case labels in switch statements 
related to 0029152 closedbugmaster Coding Rules - eliminate GCC compiler warnings -Wmisleading-indentation when using MinGW 

Activities

git

2017-09-28 10:26

administrator   ~0070933

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.

git

2017-09-28 22:43

administrator   ~0070949

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.

git

2017-09-29 10:01

administrator   ~0070953

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.

abv

2017-09-29 10:01

manager   ~0070954

Fix is pushed to CR29151_1, please review

git

2017-09-29 20:18

administrator   ~0071078

Branch CR29151_1 has been updated forcibly by abv.

SHA-1: cc710a7df081ea38b855d44cf0e76e9441c64609

bugmaster

2017-10-03 09:40

administrator   ~0071133

Tested in framework of testing issue 29170

msv

2017-10-03 12:53

developer   ~0071149

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.

abv

2017-10-03 15:11

manager   ~0071158

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!

msv

2017-10-03 16:18

developer   ~0071160

I have created the bug 0029178 to solve the issue with line-plane extrema.

git

2017-10-04 15:28

administrator   ~0071197

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.

abv

2017-10-04 23:02

manager   ~0071221

Please integrate corrected version in branch CR29151_2; tests have passed with no diffs - see last run of Jenkins job CR29151-master-abv

bugmaster

2017-10-05 13:20

administrator   ~0071234

Tested in scope 29170

git

2017-10-14 12:19

administrator   ~0071464

Branch CR29151 has been deleted by kgv.

SHA-1: 6946692c9341c54353d10e29a07c4d0aa3089761

git

2017-10-14 12:19

administrator   ~0071465

Branch CR29151_1 has been deleted by kgv.

SHA-1: cc710a7df081ea38b855d44cf0e76e9441c64609

git

2017-10-14 12:20

administrator   ~0071466

Branch CR29151_2 has been deleted by kgv.

SHA-1: b1811c1d2b78aab36e2e75d0a2191cc768e9c232

Related Changesets

occt: master b1811c1d

2017-09-28 07:26:47

abv


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

Issue History

Date Modified Username Field Change
2017-09-28 10:24 abv New Issue
2017-09-28 10:24 abv 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 abv Relationship added parent of 0029157
2017-09-29 09:20 abv Relationship added parent of 0029158
2017-09-29 09:22 abv Description Updated
2017-09-29 10:01 git Note Added: 0070953
2017-09-29 10:01 abv Note Added: 0070954
2017-09-29 10:01 abv Assigned To kgv => msv
2017-09-29 10:01 abv Status new => resolved
2017-09-29 10:01 abv 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 msv Note Added: 0071149
2017-10-03 12:53 msv Assigned To bugmaster => abv
2017-10-03 12:53 msv Status tested => assigned
2017-10-03 15:11 abv Note Added: 0071158
2017-10-03 16:18 msv Note Added: 0071160
2017-10-04 15:28 git Note Added: 0071197
2017-10-04 23:02 abv Note Added: 0071221
2017-10-04 23:02 abv Assigned To abv => kgv
2017-10-04 23:02 abv Status assigned => resolved
2017-10-04 23:02 abv Assigned To kgv => bugmaster
2017-10-04 23:02 abv 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 abv Changeset attached => occt master b1811c1d
2017-10-06 14:55 abv Assigned To bugmaster => abv
2017-10-06 14:55 abv Status tested => verified
2017-10-06 14:55 abv 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 aiv Fixed in Version => 7.3.0
2018-06-29 21:19 aiv Status verified => closed