From 3c57752c9b9575c00f5fc0e5f8a4eecebd3f5f7a Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Thu, 22 Dec 2022 11:39:00 +0100 Subject: [PATCH] posix.cfg: Added support for more posix_trace..() functions --- cfg/posix.cfg | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ test/cfg/posix.c | 45 ++++++++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index fdda32e01..c7a6ff440 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -4739,6 +4739,95 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s + + + + + false + + + + + + + + + + + 0: + + + + + + + + + + + + false + + + + + + + + + + + + + + 0: + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + 0: + + + + + + + + + + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index 293248aab..fa34dec54 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -36,6 +36,51 @@ #include #include +#if __TRACE_H__ // +void nullPointer_posix_trace_trygetnext_event(trace_id_t trid, + struct posix_trace_event_info *event, + void *data, size_t num_bytes, + size_t *data_len, int *unavailable) +{ + // cppcheck-suppress nullPointer + (void) posix_trace_trygetnext_event(trid, NULL, data, num_bytes, data_len, unavailable); + // cppcheck-suppress nullPointer + (void) posix_trace_trygetnext_event(trid, event, NULL, num_bytes, data_len, unavailable); + // cppcheck-suppress nullPointer + (void) posix_trace_trygetnext_event(trid, event, data, num_bytes, NULL, unavailable); + // cppcheck-suppress nullPointer + (void) posix_trace_trygetnext_event(trid, event, data, num_bytes, data_len, NULL); +} + +int nullPointer_posix_trace_timedgetnext_event(trace_id_t trid, struct posix_trace_event_info *restrict event, void *restrict data, size_t num_bytes, size_t *restrict data_len, int *restrict unavailable, const struct timespec *restrict abstime) +{ + // cppcheck-suppress nullPointer + (void) posix_trace_timedgetnext_event(trid, NULL, data, num_bytes, data_len, unavailable, abstime); + // cppcheck-suppress nullPointer + (void) posix_trace_timedgetnext_event(trid, event, NULL, num_bytes, data_len, unavailable, abstime); + // cppcheck-suppress nullPointer + (void) posix_trace_timedgetnext_event(trid, event, data, num_bytes, NULL, unavailable, abstime); + // cppcheck-suppress nullPointer + (void) posix_trace_timedgetnext_event(trid, event, data, num_bytes, data_len, NULL, abstime); + // cppcheck-suppress nullPointer + (void) posix_trace_timedgetnext_event(trid, event, data, num_bytes, data_len, unavailable, NULL); + return posix_trace_timedgetnext_event(trid, event, data, num_bytes, data_len, unavailable, abstime); +} + +int nullPointer_posix_trace_getnext_event(trace_id_t trid, struct posix_trace_event_info *restrict event, void *restrict data, size_t num_bytes, size_t *restrict data_len, int *restrict unavailable) +{ + // cppcheck-suppress nullPointer + (void) posix_trace_getnext_event(trid, NULL, data, num_bytes, data_len, unavailable); + // cppcheck-suppress nullPointer + (void) posix_trace_getnext_event(trid, event, NULL, num_bytes, data_len, unavailable); + // cppcheck-suppress nullPointer + (void) posix_trace_getnext_event(trid, event, data, num_bytes, NULL, unavailable); + // cppcheck-suppress nullPointer + (void) posix_trace_getnext_event(trid, event, data, num_bytes, data_len, NULL); + return posix_trace_getnext_event(trid, event, data, num_bytes, data_len, unavailable); +} +#endif // __TRACE_H__ + 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);