[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MISRA C:2012 D4.11 caution on staging
- To: Julien Grall <julien@xxxxxxx>
- From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
- Date: Wed, 18 Oct 2023 14:30:03 +0200
- Cc: Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, consulting@xxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, roger.pau@xxxxxxxxxx, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Wed, 18 Oct 2023 12:30:07 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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'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,
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)
|