Change switch fallthrough#815
Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom Jul 10, 2025
Merged
Conversation
Contributor
ejohnstown
commented
Jul 10, 2025
- Remove the macro definition and checks for the value "NO_BREAK".
- Use the wolfCrypt defined macro FALL_THROUGH instead of NO_BREAK.
1. Remove the macro definition and checks for the value "NO_BREAK". 2. Use the wolfCrypt defined macro FALL_THROUGH instead of NO_BREAK.
There was a problem hiding this comment.
Pull Request Overview
This PR removes the custom NO_BREAK fall-through macro and updates all switch statements to use the FALL_THROUGH macro defined by wolfCrypt.
- Drop
NO_BREAKdefinition fromwolfssh/port.h - Replace all
NO_BREAK;usages withFALL_THROUGH;in SFTP, SCP, SSH, and internal code
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| wolfssh/port.h | Remove legacy NO_BREAK macro definitions |
| src/wolfsftp.c | Swap NO_BREAK for FALL_THROUGH in SFTP flows |
| src/wolfscp.c | Swap NO_BREAK for FALL_THROUGH in SCP flows |
| src/ssh.c | Swap NO_BREAK for FALL_THROUGH in SSH states |
| src/internal.c | Swap NO_BREAK for FALL_THROUGH in internal flows |
Comments suppressed due to low confidence (2)
wolfssh/port.h:1508
- [nitpick] Consider adding a brief comment noting that
NO_BREAKwas removed in favor of the upstreamFALL_THROUGHmacro, so future maintainers understand why the old definitions are gone.
#ifndef WOLFSSH_UNUSED
wolfssh/port.h:1508
- [nitpick] Ensure that
FALL_THROUGHis always defined in this translation unit (e.g. provide a no-op fallback) or include the header where it’s defined, to prevent build errors on compilers without the attribute.
#ifndef WOLFSSH_UNUSED
JacobBarthelmeh
approved these changes
Jul 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.