-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Fix/remove fallthrough #13084
Fix/remove fallthrough #13084
Conversation
…mware into fix/remove_fallthrough
class Takeoff::StateHandler | ||
{ | ||
public: | ||
static void handleDisarmed(const StateParams& params); |
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.
maybe these should be inlined, then we are closer to the switch fallthrough implementation
Should probably be noted this is just a refactor, there is no external change to the module |
if (!armed) { | ||
_takeoff_state = TakeoffState::disarmed; | ||
else | ||
{ |
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.
remove new line before brace
|
||
default: | ||
break; | ||
if (!armed) { |
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.
spacing
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.
apply clang-tidy format to file
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.
We use astyle. To format your code locally before uploading just run make format
and it will automatically be corrected.
whats the target c++ standard for the project? C++17 added a [[fallthrough]] attribute, that might be a better solution |
Nevermind found my own answer, the root CMakeList sets c++11 to be required standard, therefore the attribute shouldn't be considered an option |
@thomaswatters I really appreciate that you took the time to look into the
This ccache bug was fixed a long time ago but we are still supporting vanilla Ubuntu 16.04 because there are certain ROS computer vision applications only running on 16.04. The future way will like you already suggested be to switch to C++17 and use the Your proposed solution with the |
@thomaswatters I wrote another comment summarizing all the findings in the original issue: #12813 (comment) Would you agree if we close this pr? |
certainly |
Describe problem solved by the proposed pull request
While browsing source I saw mc_pos_control had a compiler flag with a TODO to modify to remove it. Was an easy enough change
Test data / coverage
Can't find unit tests that cover flight stack modules
Describe your preferred solution
Extract the switch fallthrough statements into function flows
Describe possible alternatives
Countless