docs/misra/rules.rst: allow string literals with memcmp

Rule 21.16 is about the types of arguments allowed for memcmp. Add
string literals to the allow-list under specific conditions.

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Stefano Stabellini authored and Stefano Stabellini committed 2025-07-08 09:57:41 -07:00
1 parent 578b34adb1
commit f90610e6a7
1 file changed
+3 -1
+3 -1
View File
@@ -813,7 +813,9 @@ maintainers if you want to suggest a change.
shall point to either a pointer type, an essentially signed type, shall point to either a pointer type, an essentially signed type,
an essentially unsigned type, an essentially Boolean type or an an essentially unsigned type, an essentially Boolean type or an
essentially enum type essentially enum type
- void* arguments are allowed - void* arguments are allowed. string literal arguments are allowed
when the last argument passed for the comparison is less or equal
to the size of the string.
* - `Rule 21.17 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_17.c>`_ * - `Rule 21.17 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_21_17.c>`_
- Mandatory - Mandatory
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.