MantisBT - Open CASCADE
View Issue Details
0029151Open CASCADE[OCCT] OCCT:Codingpublic2017-09-28 10:242018-06-29 21:19
abv 
abv 
normalminor 
closedfixed 
 
[OCCT] 7.3.0[OCCT] 7.3.0 
Not required
0029151: Coding Rules - eliminate GCC compiler warnings -Wimplicit-fallthrough
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.
Build with GCC 7
No tags attached.
parent of 0029157closed bugmaster Modeling - suspicious pass-through of case labels in switch statements 
parent of 0029158closed bugmaster Visualization - suspicious pass-through of case labels in switch statements 
related to 0029152closed bugmaster Coding Rules - eliminate GCC compiler warnings -Wmisleading-indentation when using MinGW 
Issue History
2017-09-28 10:24abvNew Issue
2017-09-28 10:24abvAssigned To => kgv
2017-09-28 10:26gitNote Added: 0070933
2017-09-28 13:04kgvRelationship addedrelated to 0029152
2017-09-28 21:51kgvSummaryGCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=] => Coding Rules - eliminate GCC compiler warnings -Wimplicit-fallthrough
2017-09-28 22:43gitNote Added: 0070949
2017-09-29 09:17abvRelationship addedparent of 0029157
2017-09-29 09:20abvRelationship addedparent of 0029158
2017-09-29 09:22abvDescription Updatedbug_revision_view_page.php?rev_id=17760#r17760
2017-09-29 10:01gitNote Added: 0070953
2017-09-29 10:01abvNote Added: 0070954
2017-09-29 10:01abvAssigned Tokgv => msv
2017-09-29 10:01abvStatusnew => resolved
2017-09-29 10:01abvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17762#r17762
2017-09-29 11:27kgvDescription Updatedbug_revision_view_page.php?rev_id=17770#r17770
2017-09-29 20:18gitNote Added: 0071078
2017-10-03 09:39bugmasterAssigned Tomsv => bugmaster
2017-10-03 09:39bugmasterStatusresolved => reviewed
2017-10-03 09:40bugmasterNote Added: 0071133
2017-10-03 09:40bugmasterStatusreviewed => tested
2017-10-03 09:52bugmasterTest case number => Not required
2017-10-03 12:53msvNote Added: 0071149
2017-10-03 12:53msvAssigned Tobugmaster => abv
2017-10-03 12:53msvStatustested => assigned
2017-10-03 15:11abvNote Added: 0071158
2017-10-03 16:18msvNote Added: 0071160
2017-10-04 15:28gitNote Added: 0071197
2017-10-04 23:02abvNote Added: 0071221
2017-10-04 23:02abvAssigned Toabv => kgv
2017-10-04 23:02abvStatusassigned => resolved
2017-10-04 23:02abvAssigned Tokgv => bugmaster
2017-10-04 23:02abvStatusresolved => reviewed
2017-10-05 13:20bugmasterNote Added: 0071234
2017-10-05 13:20bugmasterStatusreviewed => tested
2017-10-06 14:55abvChangeset attached => occt master b1811c1d
2017-10-06 14:55abvAssigned Tobugmaster => abv
2017-10-06 14:55abvStatustested => verified
2017-10-06 14:55abvResolutionopen => fixed
2017-10-14 12:19gitNote Added: 0071464
2017-10-14 12:19gitNote Added: 0071465
2017-10-14 12:20gitNote Added: 0071466
2018-06-29 21:15aivFixed in Version => 7.3.0
2018-06-29 21:19aivStatusverified => closed

Notes
(0070933)
git   
2017-09-28 10:26   
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.
(0070949)
git   
2017-09-28 22:43   
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.

(0070953)
git   
2017-09-29 10:01   
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.
(0070954)
abv   
2017-09-29 10:01   
Fix is pushed to CR29151_1, please review
(0071078)
git   
2017-09-29 20:18   
Branch CR29151_1 has been updated forcibly by abv.

SHA-1: cc710a7df081ea38b855d44cf0e76e9441c64609
(0071133)
bugmaster   
2017-10-03 09:40   
Tested in framework of testing issue 29170
(0071149)
msv   
2017-10-03 12:53   
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.
(0071158)
abv   
2017-10-03 15:11   
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!
(0071160)
msv   
2017-10-03 16:18   
I have created the bug 0029178 to solve the issue with line-plane extrema.
(0071197)
git   
2017-10-04 15:28   
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.
(0071221)
abv   
2017-10-04 23:02   
Please integrate corrected version in branch CR29151_2; tests have passed with no diffs - see last run of Jenkins job CR29151-master-abv
(0071234)
bugmaster   
2017-10-05 13:20   
Tested in scope 29170
(0071464)
git   
2017-10-14 12:19   
Branch CR29151 has been deleted by kgv.

SHA-1: 6946692c9341c54353d10e29a07c4d0aa3089761
(0071465)
git   
2017-10-14 12:19   
Branch CR29151_1 has been deleted by kgv.

SHA-1: cc710a7df081ea38b855d44cf0e76e9441c64609
(0071466)
git   
2017-10-14 12:20   
Branch CR29151_2 has been deleted by kgv.

SHA-1: b1811c1d2b78aab36e2e75d0a2191cc768e9c232