From b96d8ec2ce4c4c78b2744cb97c7e0724f2f97bd7 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 5 Jan 2024 15:01:53 +0100 Subject: [PATCH 1/3] posix.cfg: Added support for strxfrm_l --- cfg/posix.cfg | 24 ++++++++++++++++++++++++ test/cfg/posix.c | 11 +++++++++++ 2 files changed, 35 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index 73197fad4c1..1a90eea0963 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -4179,6 +4179,30 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s 0: + + + + + false + + + + + + + + + + + + + + 0: + + + + + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 27f296de988..88cbb042f09 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -102,6 +102,17 @@ int nullPointer_posix_trace_getnext_event(trace_id_t trid, struct posix_trace_ev } #endif // __TRACE_H__ +size_t nullPointer_strxfrm_l(char *restrict dest, const char *restrict src, size_t count, locale_t locale) +{ + (void)strxfrm_l(dest, src, count, locale); + // In case the 3rd argument is 0, the 1st argument is permitted to be a null pointer. (#6306) + (void)strxfrm_l(NULL, src, 0, locale); + (void)strxfrm_l(NULL, src, 1, locale); + (void)strxfrm_l(NULL, src, count, locale); + // cppcheck-suppress nullPointer + return strxfrm_l(dest, NULL, count, locale); +} + void nullPointer_pthread_attr_getstack(const pthread_attr_t *attr, void *stackaddr, size_t stacksize) { // cppcheck-suppress nullPointer (void) pthread_attr_getstack(NULL, &stackaddr, &stacksize); From 7f4151f6953c84713993e2c22d3763e986dfb562 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 5 Jan 2024 15:51:23 +0100 Subject: [PATCH 2/3] Attempt to fix MAC build --- test/cfg/posix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 88cbb042f09..2e4a87487d2 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -31,14 +31,16 @@ #include #include #include +#include +#include #if !(defined(__APPLE__) && defined(__MACH__)) +#include #include #endif #include #include #include -#include -#include + #if !(defined(__APPLE__) && defined(__MACH__)) void nullPointer_mq_timedsend(mqd_t mqdes, const char* msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec* abs_timeout) { From 778aa6bcc2b1c2a4db8b4cb10d5b74fe03a6f284 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Fri, 5 Jan 2024 15:56:08 +0100 Subject: [PATCH 3/3] Attempt to fix MAC build --- test/cfg/posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 2e4a87487d2..1e6de23ca83 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -33,8 +33,10 @@ #include #include #include -#if !(defined(__APPLE__) && defined(__MACH__)) +#if defined(__APPLE__) #include +#endif +#if !(defined(__APPLE__) && defined(__MACH__)) #include #endif #include