Skip to content
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 #2478, Add missing default/break to switch statements #2479

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thnkslprpt
Copy link
Contributor

Checklist

Describe 2the contribution

Testing performed
GitHub CI actions all passing successfully (incl. Build + Run, Unit/Functional Tests etc.).
Note: Most of the added default case lines are not tested (impossible to test given that all cases are handled explicitly) so the number of missed lines has grown larger.

Expected behavior changes
Effectively no change to current behavior.
Ensuring switch statements are well-formed is good defensive coding for future code changes and improves consistency across cFE.

System(s) tested on
Debian GNU/Linux 11 (bullseye)
Current main branch of cFS bundle.

Contributor Info
Avi Weiss   @thnkslprpt

@thnkslprpt
Copy link
Contributor Author

I can also add a comment in for each default if it's worthwhile - something like:
/* Not currently implemented - should never get here as all cases are handled explicitly. */

@thnkslprpt thnkslprpt changed the title Fix #2478, Add missing deafult/break to switch statements Fix #2478, Add missing default/break to switch statements Jan 25, 2024
@thnkslprpt thnkslprpt force-pushed the fix-2478-add-missing-break-default-to-switches branch 2 times, most recently from 0f24968 to b292fe6 Compare January 25, 2024 22:12
@thnkslprpt thnkslprpt force-pushed the fix-2478-add-missing-break-default-to-switches branch from b292fe6 to 5a464f5 Compare March 23, 2024 10:48
@thnkslprpt thnkslprpt force-pushed the fix-2478-add-missing-break-default-to-switches branch from 5a464f5 to a7654a2 Compare March 23, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Several switch statements in cFE are missing a default and/or break
1 participant