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

Re: [XEN PATCH v2 1/3] EFI: address a violation of MISRA C Rule 13.6



On Wed, Oct 02, 2024 at 05:36:47PM -0700, Stefano Stabellini wrote:
> On Mon, 30 Sep 2024, Federico Serafini wrote:
> > guest_handle_ok()'s expansion contains a sizeof() involving its
> > first argument which is guest_handle_cast().
> > The expansion of the latter, in turn, contains a variable
> > initialization.
> > 
> > Since MISRA considers the initialization (even of a local variable)
> > a side effect, the chain of expansions mentioned above violates
> > MISRA C:2012 Rule 13.6 (The operand of the `sizeof' operator shall not
> > contain any expression which has potential side effect).
> > 
> > Refactor the code to address the rule violation.
> > 
> > Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> > Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

Acked-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

Attachment: signature.asc
Description: PGP signature


 


Rackspace

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