|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH v3] xen/string: address violations of MISRA C:2012 Rules 8.2 and 8.3
On 08/11/23 10:18, Jan Beulich wrote: (re-adding xen-devel@) On 08.11.2023 09:43, Federico Serafini wrote:On 08/11/23 09:07, Jan Beulich wrote:On 07.11.2023 16:18, Federico Serafini wrote:Add missing parameter names and make function declarations and definitions consistent. Mismatches between parameter names "count" and "n" are resolved in favor of "n", being the same name used by the C standard.I'm afraid this wasn't done consistently:--- a/xen/include/xen/string.h +++ b/xen/include/xen/string.h @@ -12,27 +12,27 @@ #define strncpy __xen_has_no_strncpy__ #define strncat __xen_has_no_strncat__-size_t strlcpy(char *, const char *, size_t);-size_t strlcat(char *, const char *, size_t); -int strcmp(const char *, const char *); -int strncmp(const char *, const char *, size_t); -int strcasecmp(const char *, const char *); -int strncasecmp(const char *, const char *, size_t); -char *strchr(const char *, int); -char *strrchr(const char *, int); -char *strstr(const char *, const char *); -size_t strlen(const char *); -size_t strnlen(const char *, size_t); -char *strpbrk(const char *, const char *); -char *strsep(char **, const char *); -size_t strspn(const char *, const char *); - -void *memset(void *, int, size_t); -void *memcpy(void *, const void *, size_t); -void *memmove(void *, const void *, size_t); -int memcmp(const void *, const void *, size_t); -void *memchr(const void *, int, size_t); -void *memchr_inv(const void *, int, size_t); +size_t strlcpy(char *dest, const char *src, size_t size); +size_t strlcat(char *dest, const char *src, size_t size); +int strcmp(const char *cs, const char *ct); +int strncmp(const char *cs, const char *ct, size_t count);There's still "count" here and ...+int strcasecmp(const char *s1, const char *s2); +int strncasecmp(const char *s1, const char *s2, size_t len); +char *strchr(const char *s, int c); +char *strrchr(const char *s, int c); +char *strstr(const char *s1, const char *s2); +size_t strlen(const char *s); +size_t strnlen(const char *s, size_t count); +char *strpbrk(const char *cs,const char *ct); +char *strsep(char **s, const char *ct); +size_t strspn(const char *s, const char *accept); + +void *memset(void *s, int c, size_t n); +void *memcpy(void *dest, const void *src, size_t n); +void *memmove(void *dest, const void *src, size_t n); +int memcmp(const void *cs, const void *ct, size_t count);... here (not counting functions which aren't part of the C standard). Otoh I'm unsure I understand that part of the description correctly: There was no disagreement for any of ... Alright. Before sending another version I will wait a few hours to see if other maintainers have anything to say about "inconsistencies" vs "reduced code churn". -- Federico Serafini, M.Sc. Software Engineer, BUGSENG (http://bugseng.com)
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |