[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH 5/7] xen/arm: traps: add ASSERT_UNREACHABLE() where needed
Hi Nicola, On 11/12/2023 14:54, Nicola Vetrini wrote: On 2023-12-11 13:32, Julien Grall wrote:Hi, On 11/12/2023 10:30, Nicola Vetrini wrote:I don't understand why this is necessary. The code should never be reachable because do_unexpected_trap() is a noreturn().The branches of the switch after a call to 'do_unexpected_trap' cannot return, but there is one path that may return, hence only some clauses are marked with ASSERT_UNREACHABLE().Cheers,It was meant as a safeguard against mistakes. I am confused about which mistakes you are trying to prevent. Are you saying you are not trusting the noreturn attribute? And if so, are you intending to add ASSERT_UNREACHABLE() after every single call to noreturn functions? There are MISRA rules that deal with this aspect (e.g., a noreturn function should not return), but they are not in Amendment 2, which is what Xen is following.Do you mind providing a bit more details about the rules you are talking about? At least the numbers would be helpful. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |