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

Remove undefined bahaviour #54

Closed
wants to merge 1 commit into from
Closed

Remove undefined bahaviour #54

wants to merge 1 commit into from

Conversation

ericcurtin
Copy link
Contributor

control reaches end of non-void function warning. In case no label
matches just return an empty string to avoid undefined beahviour.

control reaches end of non-void function warning. In case no label
matches just return an empty string to avoid undefined beahviour.
Copy link
Contributor

@mingtaoy mingtaoy left a comment

Choose a reason for hiding this comment

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

Thanks for the patch. I think the real intention was to omit the default case so that -Werror=switch would compile-fail on a non-exhaustive switch. For non-debug builds, this should really be an exception, as returning an empty string would likely break the expected format.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@mingtaoy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@mingtaoy merged this pull request in c9b3497.

@ericcurtin
Copy link
Contributor Author

ericcurtin commented Jul 14, 2020

Thanks @mingtaoy that -Wswitch use-case is quite useful I guess, my housemate actually suspected that was the case. My mvfst build was taking ages so I started looking at some of the warnings being spit out. :)

@ericcurtin ericcurtin deleted the patch-2 branch July 14, 2020 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants