docs/misra: add Rule 7.4 and 9.4

Rule 9.4 is non-controversial and we have no violations.

Rule 7.4 is considered a good idea with the caveat that assigning a
string literal to const void is allowed. I added a note to specify it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
This commit is contained in:
Stefano Stabellini committed 2023-07-11 13:14:12 -07:00
1 parent b831326ee2
commit 67f6063b1b
1 file changed
+14
+14
View File
@@ -203,6 +203,15 @@ maintainers if you want to suggest a change.
- The lowercase character l shall not be used in a literal suffix - The lowercase character l shall not be used in a literal suffix
- -
* - `Rule 7.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_07_04.c>`_
- Required
- A string literal shall not be assigned to an object unless the
object type is pointer to const-qualified char
- All "character types" are permitted, as long as the string
element type and the character type match. (There should be no
casts.) Assigning a string literal to any object with type
"pointer to const-qualified void" is allowed.
* - `Rule 8.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_08_01.c>`_ * - `Rule 8.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_08_01.c>`_
- Required - Required
- Types shall be explicitly specified - Types shall be explicitly specified
@@ -275,6 +284,11 @@ maintainers if you want to suggest a change.
braces braces
- -
* - `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
-
* - `Rule 12.5 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_12_05.c>`_ * - `Rule 12.5 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_12_05.c>`_
- Mandatory - Mandatory
- The sizeof operator shall not have an operand which is a function - The sizeof operator shall not have an operand which is a function
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.