[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MISRA C:2012 D4.11 caution on staging



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't
once 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,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.