[LU-15492] Fix fallthrough decorator to use __attribute__((fallthrough)) for gcc 7 Created: 28/Jan/22  Updated: 05/Jul/22  Resolved: 11/Jun/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0, Lustre 2.15.1

Type: Bug Priority: Minor
Reporter: Shaun Tancheff Assignee: Shaun Tancheff
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Using the new fallthrough macro, building on openSUSE 15 with gcc-7.5

error: this statement may fall through [-Werror=implicit-fallthrough=]

Where the fallthrough attribute is available prefer it over a no-op suppression of
the implicit fallthrough warning.

Ex:

# if defined(__GNUC__) && __GNUC__ >= 7
#  define fallthrough  __attribute__((fallthrough)) /* fallthrough */
# else
#  define fallthrough do {} while (0)  /* fallthrough */
# endif


 Comments   
Comment by Gerrit Updater [ 28/Jan/22 ]

"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/46357
Subject: LU-15492 build: fallthrough macro for pre/post gcc-7
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 51f7cf74e67ceb23d7da44f16cdcb4131fe5bfaf

Comment by Gerrit Updater [ 11/Jun/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46357/
Subject: LU-15492 build: fallthrough macro for pre/post gcc-7
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 7b54fc7b1615f23a1ad9da84ba8e289de1f22d70

Comment by Peter Jones [ 11/Jun/22 ]

Landed for 2.16

Comment by Gerrit Updater [ 23/Jun/22 ]

"Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47708
Subject: LU-15492 build: fallthrough macro for pre/post gcc-7
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: fe41df79987bf7bdd8c76299a3c223ce560c0529

Comment by Gerrit Updater [ 05/Jul/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47708/
Subject: LU-15492 build: fallthrough macro for pre/post gcc-7
Project: fs/lustre-release
Branch: b2_15
Current Patch Set:
Commit: 2fd2a6fb7f6935624d327e8bfe25dd3955066429

Generated at Sat Feb 10 03:18:46 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.