On 2023-12-11 13:32, Julien Grall wrote:
Hi,

On 11/12/2023 10:30, Nicola Vetrini wrote:
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().
I don't understand why this is necessary. The code should never be reachable because do_unexpected_trap() is a noreturn().

Cheers,

It was meant as a safeguard against mistakes. 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.

--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)

Reply via email to