[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH 7/7] x86/xstate: move BUILD_BUG_ON to address MISRA C:2012 Rule 2.1
On 2023-12-12 11:07, Jan Beulich wrote: On 12.12.2023 11:04, Jan Beulich wrote:On 11.12.2023 11:30, Nicola Vetrini wrote:The string literal inside the expansion of BUILD_BUG_ON is considered unreachable code; however, such statement can be moved earlier with no functional change.First: Why is this deemed dead code in its present position, but okay whenmoved? Second: While moving is indeed no functional change (reallyBUILD_BUG_ON() can be moved about anywhere, for not producing any code in the final binary), it removes the connection between it and the respectiveasm() (where %z would have been nice to use).Oh, and third: Which string literal? I expect you're not building with an ancient compiler, so it got to be#define BUILD_BUG_ON(cond) ({ _Static_assert(!(cond), "!(" #cond ")"); })which you see in use. Yet that string literal isn't "code" or "data", but an argument to _Static_assert(). Is Eclair perhaps not properly aware of_Static_assert()? Jan On further inspection, this should have fallen into the deviation for pure decls. This patch can be dropped, we'll adjust this inside ECLAIR. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |