[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/3] docs/misra/rules.rst: add rule 16.6 and 20.12
 
- To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
 
- From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
 
- Date: Fri, 01 Mar 2024 09:00:55 +0100
 
- Cc: Stefano Stabellini <stefano.stabellini@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, jbeulich@xxxxxxxx, george.dunlap@xxxxxxxxxx, julien@xxxxxxx, bertrannd.marquis@xxxxxxx, roger.pau@xxxxxxxxxx, roberto.bagnara@xxxxxxxxxxx, federico.serafini@xxxxxxxxxxx, Luca.Fancellu@xxxxxxx, michal.orzel@xxxxxxx
 
- Delivery-date: Fri, 01 Mar 2024 08:00:59 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
On 2024-03-01 02:56, Stefano Stabellini wrote:
 
Hi all,
This patch broke gitlab-ci. The jobs failing are the cppcheck jobs.
xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j80
No summary for rule 20.12
 WARNING: Can't open 
/builds/xen-project/hardware/xen/xen/drivers/video/font_8x14.c: 'utf-8' 
codec can't decode byte 0x9f in position 7228: invalid start byte
WARNING: Can't open 
/builds/xen-project/hardware/xen/xen/drivers/video/font_8x16.c: 'utf-8' 
codec can't decode byte 0x80 in position 5436: invalid start byte
WARNING: Can't open 
/builds/xen-project/hardware/xen/xen/drivers/video/font_8x8.c: 'utf-8' 
codec can't decode byte 0x80 in position 4410: invalid start byte
ERROR: An error occured when running:
 /builds/xen-project/hardware/xen/xen/tools/convert_misra_doc.py -i 
/builds/xen-project/hardware/xen/docs/misra/rules.rst -o 
/builds/xen-project/hardware/xen/xen/cppcheck-misra.txt -j 
/builds/xen-project/hardware/xen/xen/cppcheck-misra.json
I'll look into it as soon as possible.
On Tue, 13 Feb 2024, Stefano Stabellini wrote:
 
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
 docs/misra/rules.rst | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 182331089d..c185366966 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -478,6 +478,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 +560,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.
+
 
 
 
 I think here it wants the strictness "Required" first, and then the 
headline second "A macro parameter..."
     * - `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
--
2.25.1
 
 
--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)
 
 
    
     |