From 70ea3c29028ccb6237663db0f27398862a18ab6d Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Thu, 22 Dec 2022 09:12:57 +0100 Subject: [PATCH] posix.cfg: Added nullPointer tests for getop() --- test/cfg/posix.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/cfg/posix.c b/test/cfg/posix.c index e6d0f8f65..b1986f7ca 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -36,6 +36,15 @@ #include #include +int nullPointer_getopt(int argc, char* const argv[], const char* optstring) +{ + // cppcheck-suppress nullPointer + (void) getopt(argc, NULL, optstring); + // cppcheck-suppress nullPointer + (void) getopt(argc, argv, NULL); + return getopt(argc, argv, optstring); +} + int invalidFunctionArgStr_mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio) { // No warning is expected for: