Skip to content

Commit

Permalink
test/cfg: simplified MacOS preprocessor checks / also suppressed `pur…
Browse files Browse the repository at this point in the history
…gedConfiguration` warning

```
"/home/runner/work/cppcheck/cppcheck/test/cfg/gnu.c:0:information:purgedConfiguration:The configuration '__APPLE__;__CYGWIN__' was not checked because its code equals another one."
```
  • Loading branch information
firewave committed Sep 18, 2024
1 parent 2fd671b commit 77ad89d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions test/cfg/gnu.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
//

// cppcheck-suppress-file valueFlowBailout
// cppcheck-suppress-file [valueFlowBailout,purgedConfiguration]

#define _GNU_SOURCE

Expand All @@ -23,7 +23,7 @@
#include <sys/mman.h>
#include <sys/sem.h>
#include <wchar.h>
#if !defined(__CYGWIN__) && !(defined(__APPLE__) && defined(__MACH__))
#if !defined(__CYGWIN__) && !defined(__APPLE__)
#include <sys/epoll.h>
#endif
#include <strings.h>
Expand Down Expand Up @@ -492,7 +492,7 @@ void leakReturnValNotUsed()
return;
}

#if !defined(__CYGWIN__) && !(defined(__APPLE__) && defined(__MACH__))
#if !defined(__CYGWIN__) && !defined(__APPLE__)
int nullPointer_epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
{
// no warning is expected
Expand Down
8 changes: 4 additions & 4 deletions test/cfg/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
//

// cppcheck-suppress-file [valueFlowBailout,purgedConfiguration]
// cppcheck-suppress-file [valueFlowBailout]

#define _BSD_SOURCE
#define _XOPEN_SOURCE // wcwidth
Expand Down Expand Up @@ -39,7 +39,7 @@
#if defined(__APPLE__)
#include <xlocale.h>
#endif
#if !(defined(__APPLE__) && defined(__MACH__))
#if !defined(__APPLE__)
#include <mqueue.h>
#endif
#include <stdlib.h>
Expand All @@ -49,7 +49,7 @@
#include <utime.h>


#if !(defined(__APPLE__) && defined(__MACH__))
#if !defined(__APPLE__)
void nullPointer_mq_timedsend(mqd_t mqdes, const char* msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec* abs_timeout) {
// cppcheck-suppress nullPointer
(void) mq_timedsend(mqdes, NULL, msg_len, msg_prio, abs_timeout);
Expand Down Expand Up @@ -171,7 +171,7 @@ int nullPointer_getopt(int argc, char* const argv[], const char* optstring)
return getopt(argc, argv, optstring);
}

#if !(defined(__APPLE__) && defined(__MACH__))
#if !defined(__APPLE__)
int invalidFunctionArgStr_mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio)
{
// No warning is expected for:
Expand Down

0 comments on commit 77ad89d

Please sign in to comment.