docs/misra: add Rule 9.3
PATCH 1/1 docs/misra: add Rule 9.3
From: Stefano Stabellini <[email protected]>
Specify that {} is allowed for zero-initialization.
--- docs/misra/rules.rst | 5 +++++ 1 file changed, 5 insertions(+)
docs/misra/rules.rst +5 -0
@@ -284,6 +284,11 @@ maintainers if you want to suggest a change. braces - + * - `Rule 9.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_03.c>`_ + - Required + - Arrays shall not be partially initialized + - {} is also allowed to specify explicit zero-initialization + * - `Rule 9.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_04.c>`_ - Required - An element of an object shall not be initialized more than once
Signature · 1 line
2.25.1
Quoted 9 lines · Stefano Stabellini
From: Stefano Stabellini <[email protected]>
Specify that {} is allowed for zero-initialization.
Signed-off-by Stefano Stabellini <[email protected]>
Quoted 9 lines
---
docs/misra/rules.rst| 5 +++++1 file changed, 5 insertions(+)docs/misra/rules.rst +0
-0
docs/misra/rules.rst maintainers if you want to suggest a change. · line 290
Quoted 7 lines
docs/misra/rules.rst +4
-0@@ -284,6 +284,11 @@ maintainers if you want to suggest a change. braces - + * - `Rule 9.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_03.c>`_ + - Required + - Arrays shall not be partially initialized + - {} is also allowed to specify explicit zero-initialization
Not related to this patch, but how is the coding style for this? Is it {} without spaces or { } with one space? It’s not specified in the coding style
Quoted 8 lines
docs/misra/rules.rst +1
-0+ * - `Rule 9.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_04.c>`_ - Required - An element of an object shall not be initialized more than onceSignature · 1 line
2.25.1
Jan Beulich
Acked-byQuoted 9 lines · Luca Fancellu
Quoted 7 lines · Stefano Stabellini
From: Stefano Stabellini <[email protected]>
Specify that {} is allowed for zero-initialization.
Signed-off-by Stefano Stabellini <[email protected]>Reviewed-by Luca Fancellu <[email protected]>
Quoted 6 lines
Quoted 6 lines
docs/misra/rules.rst +0
-0@@ -284,6 +284,11 @@ maintainers if you want to suggest a change. braces -
Quoted 7 lines
docs/misra/rules.rst maintainers if you want to suggest a change. · line 290
Quoted 4 lines
docs/misra/rules.rst +4
-0+ * - `Rule 9.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_03.c>`_ + - Required + - Arrays shall not be partially initialized + - {} is also allowed to specify explicit zero-initializationNot related to this patch, but how is the coding style for this? Is it {} without spaces or { } with one space? It’s not specified in the coding style
In the absence of anything written down, I'm inclined to infer both forms are acceptable.
Jan
Quoted 31 lines · Jan Beulich
Quoted 9 lines · Luca Fancellu
Quoted 7 lines · Stefano Stabellini
From: Stefano Stabellini <[email protected]>
Specify that {} is allowed for zero-initialization.
Signed-off-by Stefano Stabellini <[email protected]>Reviewed-by Luca Fancellu <[email protected]>Acked-by Jan Beulich <[email protected]>Quoted 6 lines
Quoted 6 lines
docs/misra/rules.rst +0
-0@@ -284,6 +284,11 @@ maintainers if you want to suggest a change. braces -Quoted 7 lines
docs/misra/rules.rst maintainers if you want to suggest a change. · line 290
Quoted 4 lines
docs/misra/rules.rst +4
-0+ * - `Rule 9.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_09_03.c>`_ + - Required + - Arrays shall not be partially initialized + - {} is also allowed to specify explicit zero-initializationNot related to this patch, but how is the coding style for this? Is it {} without spaces or { } with one space? It’s not specified in the coding style
Quoted 2 lines
In the absence of anything written down, I'm inclined to infer both forms are acceptable.
:) I see, that’s what I was worried, anyway you are right!
I have a WIP for clang format that would generate some discussion, but at least I hope it will clarify many of these small things that make our codebase less uniform, making us write down some rules
Quoted 2 lines
Jan