-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[C++] kernel.cc: Avoid default in switches to let the compiler warn us about missing cases #41994
Comments
kou
changed the title
kernel.cc: Avoid default in switches to let the compiler warn us about missing cases
[C++] kernel.cc: Avoid default in switches to let the compiler warn us about missing cases
Jun 6, 2024
felipecrv
added a commit
that referenced
this issue
Jun 6, 2024
… can check full enum coverage for us (#41995) ### Rationale for this change To let the compiler warn us about missing cases and make the non-handled cases more obvious. ### What changes are included in this PR? Removal of `default` in the switches and improving some dchecks with a message. ### Are these changes tested? By existing tests. * GitHub Issue: #41994 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Issue resolved by pull request 41995 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the enhancement requested
This can also be done in a way that is robust against the UB caused by reading memory that is not valid in the enum range.
Component(s)
C++
The text was updated successfully, but these errors were encountered: