Skip to content

Commit 347c10d

Browse files
committed
posix.cfg: Improved configuration of mq_timedsend().
1 parent f5b9445 commit 347c10d

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

cfg/posix.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3101,6 +3101,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
31013101
<arg nr="2" direction="in">
31023102
<not-uninit/>
31033103
<not-bool/>
3104+
<not-null/>
31043105
<minsize type="argvalue" arg="3"/>
31053106
<strz/>
31063107
</arg>
@@ -3111,6 +3112,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
31113112
<not-uninit/>
31123113
</arg>
31133114
<arg nr="5" direction="in">
3115+
<not-null/>
31143116
<not-uninit/>
31153117
<not-bool/>
31163118
</arg>
@@ -4766,7 +4768,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s
47664768
<not-null/>
47674769
</arg>
47684770
</function>
4769-
<!-- int 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); -->
4771+
<!-- int 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); -->
47704772
<function name="posix_trace_timedgetnext_event">
47714773
<returnValue type="int"/>
47724774
<noreturn>false</noreturn>

test/cfg/posix.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636
#include <string.h>
3737
#include <strings.h>
3838

39+
void nullPointer_mq_timedsend(mqd_t mqdes, const char* msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec* abs_timeout) {
40+
// cppcheck-suppress nullPointer
41+
(void) mq_timedsend(mqdes, NULL, msg_len, msg_prio, abs_timeout);
42+
// cppcheck-suppress nullPointer
43+
(void) mq_timedsend(mqdes, msg_ptr, msg_len, msg_prio, NULL);
44+
}
45+
3946
#if __TRACE_H__ // <trace.h>
4047

4148
void nullPointer_posix_trace_event(trace_event_id_t event_id, const void* restrictdata_ptr, size_t data_len)

0 commit comments

Comments
 (0)