[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] docs/misra/rules.rst: allow string literals with memcmp



commit f90610e6a7825f5aac21ae663467a0b2d0a2d465
Author:     Stefano Stabellini <sstabellini@xxxxxxxxxx>
AuthorDate: Mon Jun 23 16:45:57 2025 -0700
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Tue Jul 8 09:57:41 2025 -0700

    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@xxxxxxxx>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 docs/misra/rules.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index e1c26030e8..3e014a6298 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -813,7 +813,9 @@ maintainers if you want to suggest a change.
        shall point to either a pointer type, an essentially signed type,
        an essentially unsigned type, an essentially Boolean type or an
        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>`_
      - Mandatory
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.