-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MBED_FALLTHROUGH attribute #12032
Conversation
C++17 standardised `[[fallthrough]]` for `switch` statements to suppress compiler warnings. Provide access to it, or compiler-specific alternatives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Just to note that the GCC form here requires GCC 7. I believe it will generate an "empty declaration" warning on GCC 6. I could adjust if pre-GCC 7 compatibility is an issue. |
Well, Mbed OS uses GCC9 now in master and 5.15. onwards, so I doubt that is an issue. |
I agree here, but thought it was worth flagging for anyone considering |
Hey, it's Apache 2.0, it's fair game!-) |
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@ARMmbed/mbed-os-core Once you approve, this is ready to go in |
That doesn't look like it fixes anything and may be problematic for some users so lets push it for 6. |
Moved to 6.0.0 (@JanneKiiskila) |
@bulislaw - what is problematic about this, can you please explain? |
We are past code freeze going through RCs, as a rule only bug fixes land in the RCs. |
Please review |
@bulislaw could you review this for Core ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to turn on -Wimplicit-fallthrough
at some point.
Summary of changes
C++17 standardised
[[fallthrough]]
forswitch
statements to suppress compiler warnings. Provide access to it, or compiler-specific alternatives.Impact of changes
MBED_FALLTHROUGH
attribute added tombed_toolchain.h
- a portable equivalent for C++17's[[fallthrough]]
.Migration actions required
None
Documentation
Toolchain attributes not covered by docs
Pull request type
Test results
Reviewers
@JanneKiiskila