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

ff.c : fix fallthrough warning #2497

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

gullradriel
Copy link
Member

That PR fix the following warning introduced when enabling EXFAT :

portapack-mayhem/firmware/chibios-portapack/ext/fatfs/src/ff.c: In function 'get_fat':
portapack-mayhem/firmware/chibios-portapack/ext/fatfs/src/ff.c:1038:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
1038 | if (obj->objsize) {
| ^
portapack-mayhem/firmware/chibios-portapack/ext/fatfs/src/ff.c:1064:3: note: here
1064 | default:
| ^~~~~~~

Copy link
Contributor

@zxkmm zxkmm left a comment

Choose a reason for hiding this comment

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

Last time I didn't know if it should be fallthrough or not, so I tried both and both works I can't find difference.
Glad that you know and I trust your.

@gullradriel
Copy link
Member Author

Indeed, both comment and attribute are working.

@gullradriel gullradriel merged commit 54ad82a into portapack-mayhem:next Jan 26, 2025
3 checks passed
@gullradriel gullradriel deleted the ff_warning_fix branch January 26, 2025 15:27
@zxkmm
Copy link
Contributor

zxkmm commented Jan 26, 2025

no i mean both break or fallthrough works. but glad to know it should be fallthrough

@gullradriel
Copy link
Member Author

Ha, this.
There is a difference between break and fall through.
When you break, you go out of the switch directly.
When you fall through, you go to the next case, in our situation the default case was executed, so I kept it that way when adding the fall through flag.

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.

2 participants