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

[xen master] include/ctype.h: fix MISRA R10.2 violation



commit 21611c68702dae2e18cb519a6e166cdceeaff4ca
Author:     Stefano Stabellini <sstabellini@xxxxxxxxxx>
AuthorDate: Wed May 15 15:52:04 2024 -0700
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Thu May 16 18:03:27 2024 -0700

    include/ctype.h: fix MISRA R10.2 violation
    
    The value returned by __toupper is used in arithmetic operations causing
    MISRA C 10.2 violations. Cast to plain char in the toupper macro. Also
    do the same in tolower for consistency.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/include/xen/ctype.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/ctype.h b/xen/include/xen/ctype.h
index 6dec944a37..773ac27aa4 100644
--- a/xen/include/xen/ctype.h
+++ b/xen/include/xen/ctype.h
@@ -48,7 +48,7 @@ static inline unsigned char __toupper(unsigned char c)
        return c;
 }
 
-#define tolower(c) __tolower(c)
-#define toupper(c) __toupper(c)
+#define tolower(c) ((char)__tolower(c))
+#define toupper(c) ((char)__toupper(c))
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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