Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boot/bootutil/src/bootutil_public.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ boot_set_next(const struct flash_area *fa, bool active, bool confirm)
if (rc != 0) {
break;
}
/* Pass */
/* fallthrough */
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I follow this, it appears to be a C23 feature and is done using [] style brackets https://en.cppreference.com/c/language/attributes/fallthrough - not that doing that would be acceptable in MCUboot because of supporting old compilers. Do you have a reference to something this fixes?

Copy link
Copy Markdown
Author

@supperthomas supperthomas Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case BOOT_SWAP_TYPE_TEST:
/* fallthrough */
case BOOT_SWAP_TYPE_PERM:
if (check_downgrade_prevention(state) != 0) {
/* Downgrade prevented */

When I enable the fallthrough compilation warning as an error, an error is reported during compilation at this code segment. I have made corresponding modifications by referring to other loader.c files, which should theoretically comply with the modification conventions of MCUboot. If the old compiler fails to handle this part properly, other code areas would presumably encounter the same issue as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nordicjm So, how to fix for the warning error?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


case BOOT_MAGIC_GOOD:
if (confirm) {
Expand Down