|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH] automation/eclair: add deviations for MISRA C:2012 Rule 16.4
On 23/04/24 12:26, Jan Beulich wrote: On 23.04.2024 12:02, Federico Serafini wrote: (I placed Rule 16.4 before Rule 16.3. I will propose a new version with the correct ordering.)
The MISRA C document, within Rule 16.1 ("A switch statement shall be
well-formed") defines the syntax rules that can be used to define a
"well formed" switch statement.
When I say "switch clause", I refer to the same entity the MISRA
document refers to in the definition of such syntax rules.
In the example above, we have a single switch clause with multiple
labels and no default label: this is a violation of Rule 16.4
("Every `switch' statement shall have a `default' label") which will
be covered by the deviation.
Do you think inserting the example in rules.rst or deviations.rst could
be useful?
Here there are two switch clauses, each of them terminated by a break statement, and the default label is present: the switch is well formed, no violations of series 16 will be reported. -- Federico Serafini, M.Sc. Software Engineer, BUGSENG (http://bugseng.com)
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |