|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [RFC 1/4] x86/ioemul: address MISRA C:2012 Rule 9.3
On 2023-10-27 23:38, Stefano Stabellini wrote: On Thu, 26 Oct 2023, Jan Beulich wrote:On 26.10.2023 14:32, Nicola Vetrini wrote: > On 25/10/2023 09:56, Jan Beulich wrote: >> On 24.10.2023 22:27, Stefano Stabellini wrote: >>> On Tue, 24 Oct 2023, Jan Beulich wrote: >>>> On 24.10.2023 16:31, Nicola Vetrini wrote: >>>>> Partially explicitly initalized .matches arrays result in violations >>>>> of Rule 9.3; this is resolved by using designated initializers, >>>>> which is permitted by the Rule. >>>>> >>>>> Mechanical changes. >>>>> >>>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx> >>>> >>>> While not overly bad, I'm still not really seeing the improvement. >>>> Yet aiui changes induced by Misra are supposed to improve things in >>>> some direction? >>> >>> I think the improvement is clarity, in the sense that the designated >>> initializers make it clearer that the array may be sparsely >>> initialized >>> and that the remaining elements should be initialized to zero >>> automatically. >> >> That's as clear from the original code, imo.This specific instance is simple and might be clear either way, but in general especially in more complex scenarios and potentially nested structures and arrays, it could be harder to figure out and that leadsto errors. The MISRA checker is a powerful tool to help us make sure the Hi, any updates on this? Considering the opinions expressed above, what would be the path preferred by the community? -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |