You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
… 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>
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: