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

Re: [XEN PATCH 09/13] xen/common: address violations of MISRA C:2012 Directive 4.10



On 31/08/23 15:05, Jan Beulich wrote:
On 31.08.2023 14:54, Simone Ballarin wrote:
On 31/08/23 13:10, Jan Beulich wrote:
On 31.08.2023 12:08, Simone Ballarin wrote:
The danger of multi-inclusion also exists for .c files, why do you want
to avoid guards for them?

Counter question: Why only add guards to some of them? (My personal
answer is "Because it's extra clutter.")

It's not "some of them", it's exactly the ones used in an #include
directive, so I'm not getting your objection.

My point is that by adding guards only for files we presently use in some
#include directive, we set us up for introducing new violations as soon
as another .c file becomes the subject of an #include.The more that it
is unusual to add guards in .c files, i.e. it is to be expected that
people wouldn't think about this extra Misra requirement.

Jan

I can agree to partially adopt the directive: I will add a deviation for C files in rules.txt.

--
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com)




 


Rackspace

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