[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH] automation/eclair: add deviation for MISRA C:2012 Rule 16.6
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Federico Serafini <federico.serafini@xxxxxxxxxxx>
- Date: Mon, 4 Mar 2024 09:19:42 +0100
- Cc: consulting@xxxxxxxxxxx, Simone Ballarin <simone.ballarin@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Mon, 04 Mar 2024 08:19:53 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 04/03/24 09:04, Jan Beulich wrote:
On 01.03.2024 16:04, Federico Serafini wrote:
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -322,6 +322,12 @@ Deviations related to MISRA C:2012 Rules:
- /\* Fallthrough \*/
- /\* Fallthrough. \*/
+ * - R16.6
+ - A switch statement with a single switch clause and no default label is
+ deliberate and improves readability with respect to an equivalent if
+ statement.
+ - Tagged as `deliberate` for ECLAIR.
Imo this is another example of wording a deviation in too wide a manner.
It shouldn't be "is", but "may". Whether what is said here applies is
entirely down to every specific instance; otherwise I'm inclined to read
this as a suggestion to replace all if() by switch(), for that always
improving readability. FTAOD things would be different if this was
explanatory text to a SAF comment - there the specific context is always
given (by where the comment actually appears).
Ok, I'll rephrase a v2.
--
Federico Serafini, M.Sc.
Software Engineer, BUGSENG (http://bugseng.com)
|