[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH 0/4] Add missing default labels to switch statements
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.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.How the BUG/ASSERT_UNREACHABLE solution is going to help us here?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@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |