On 22/02/2019 11:53, Andrii Anisov wrote:
Hello Julien,
Hi,
On 22.02.19 13:30, Julien Grall wrote:
While review tend to be very thorough, it is sometimes hard to spot when we
miss a case. This is where -Wswitch comes into place to spot missing how.
How the BUG/ASSERT_UNREACHABLE solution is going to help us here?
I understand that hitting -Wswitch requires less efforts, the compilation only.
Otherwise build run, even fulfilling some conditions are needed to hit missed
enum index.
But how those `switch()` without `default:` label are protected against the
value outside the enum?
You really don't need a default case for handling such issues. You can construct
code in a way to initialize the variables with default values.
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel