mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
misra: add deviation of Rule 10.1 for unary minus
MISRA C Rule 10.1 states: "Operands shall not be of an inappropriate essential type" The unary minus operator applied to an unsigned type(s) has a semantics (wrap around) that is well-defined by the toolchains. Thus, this operation is deemed safe. No functional change. Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com> Signed-off-by: Victor Lira <victorm.lira@amd.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
This commit is contained in:
1 parent
eb6674acc4
commit
53dd9f3e92
2 files changed
+12
No files matched your search
@@ -342,6 +342,12 @@ constant expressions are required.\""
|
||||
"any()"}
|
||||
-doc_end
|
||||
|
||||
-doc_begin="Unary minus operations on unsigned type(s) have a semantics (wrap around) that is well-defined by the toolchains."
|
||||
-config=MC3A2.R10.1,etypes+={safe,
|
||||
"stmt(node(unary_operator)&&operator(minus))",
|
||||
"src_expr(definitely_in(0..))"}
|
||||
-doc_end
|
||||
|
||||
#
|
||||
# Series 11
|
||||
#
|
||||
|
||||