[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: MISRA C:2012 D4.11 caution on staging
On 17/10/2023 15:28, Julien Grall wrote: Hi Jan, On 17/10/2023 07:11, Jan Beulich wrote:On 16.10.2023 20:06, Julien Grall wrote:Instead, it would be best to find a way to help Eclair to detect this is not an issue and also improve readability. Would the following help Eclair?diff --git a/xen/common/domain.c b/xen/common/domain.c index 30c227967345..ab16124eabd6 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -671,6 +671,8 @@ struct domain *domain_create(domid_t domid, if ( !is_idle_domain(d) ) { + ASSERT(config); + watchdog_domain_init(d); init_status |= INIT_watchdog;Just to mention it: Even if right now it turned out to help, it wouldn'tonce release builds are also checked.Indeed. I thought about it when writing the e-mail yesterday. I have the feeling that we are not getting many similar report today thanks to the various ASSERT(). This may mean that the ASSERT() will have to be kept during static analysis or we deviate/add proper error checking. Cheers, I tested this, and the report is prevented by the ASSERT. It's up to the maintainers to decide how do you want to proceed: my suggestion is deviating it, and then when someone has the time to fix this with proper error handling remove the deviation. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |