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

Re: [XEN PATCH 2/2] xen/cpu: address MISRA C Rule 17.7



On 2024-02-28 23:38, Stefano Stabellini wrote:
On Wed, 28 Feb 2024, Julien Grall wrote:
Hi Nicola,

On 28/02/2024 11:09, Nicola Vetrini wrote:
> > I asked Roberto if void casts are an option for compliance.
> >
>
> void casts are an option for sure. The rationale for the rule explicitly
> lists them as a compliance mechanism. An interesting aspect is what would be
> the consensus around void casts on functions whose return value is always
> ignored vs. functions whose return value is sometimes ignored.

If a return is always ignored, then the function should return void. For the
second case, I think it will be on the case by case basis.

+1


Ok, noted.


> > In any case, I don't think we should use void casts in the specific
> > cases this patch is dealing with. Void casts (if anything) should be a
> > last resort while this patch fixes the issue in a better way.

+1.

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



 


Rackspace

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