[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v1] docs/misra/rules.rst: catch up with accepted rules
Update docs/misra/rules.rst to reflect the MISRA C rules accepted in the last couple of months. Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx> --- In the notes section I added some info about the deviations, but in any case the appropriate info will also be added to deviations.rst, safe.json, etc. I also added Rule 14.4, which is older, but when I first tried to add it to rules.rst, Jan had a question I couldn't reply clearly: https://marc.info/?l=xen-devel&m=169828285627163 I think now with this series, the impact of Rule 14.4 is clearer: https://marc.info/?l=xen-devel&m=170194257326186 diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 182331089d..0cb87ebc35 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -181,6 +181,12 @@ maintainers if you want to suggest a change. headers (xen/include/public/) are allowed to retain longer identifiers for backward compatibility. + * - `Rule 5.5 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_05.c>`_ + - Required + - Identifiers shall be distinct from macro names + - Clashes between function-like macros and non-callable entities + are allowed. The pattern #define x x is also allowed. + * - `Rule 5.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_06.c>`_ - Required - A typedef name shall be a unique identifier @@ -462,6 +468,13 @@ maintainers if you want to suggest a change. while(0) and while(1) and alike are allowed. + * - `Rule 14.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_14_04.c>`_ + - Required + - The controlling expression of an if-statement and the controlling + expression of an iteration-statement shall have essentially + Boolean type + - + * - `Rule 16.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_03.c>`_ - Required - An unconditional break statement shall terminate every @@ -478,6 +491,12 @@ maintainers if you want to suggest a change. adhere to Rule 16.2 would result in increased complexity and maintenance difficulty, and could potentially introduce bugs. + * - `Rule 16.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_06.c>`_ + - Required + - Every switch statement shall have at least two switch-clauses + - Single-clause switches are allowed when they do not involve a + default label. + * - `Rule 16.7 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_16_07.c>`_ - Required - A switch-expression shall not have essentially Boolean type @@ -554,6 +573,13 @@ maintainers if you want to suggest a change. evaluation - + * - `Rule 20.12 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_20_12.c>`_ + - A macro parameter used as an operand to the # or ## operators, + which is itself subject to further macro replacement, shall only + be used as an operand to these operators + - Required + - Variadic macros are allowed to violate the rule. + * - `Rule 20.13 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_20_13.c>`_ - Required - A line whose first token is # shall be a valid preprocessing
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |