77// No warnings about bad library configuration, unmatched suppressions, etc. exitcode=0
88//
99
10- // cppcheck-suppress-file [valueFlowBailout,purgedConfiguration ]
10+ // cppcheck-suppress-file [valueFlowBailout]
1111
1212#define _BSD_SOURCE
13+ #define _XOPEN_SOURCE // wcwidth
1314
1415#include <aio.h>
1516#include <stdio.h> // <- FILE
3839#if defined(__APPLE__ )
3940#include <xlocale.h>
4041#endif
41- #if !( defined(__APPLE__ ) && defined( __MACH__ ) )
42+ #if !defined(__APPLE__ )
4243#include <mqueue.h>
4344#endif
4445#include <stdlib.h>
4546#include <unistd.h>
4647#include <wchar.h>
48+ #include <sys/stat.h>
49+ #include <utime.h>
4750
4851
49- #if !( defined(__APPLE__ ) && defined( __MACH__ ) )
52+ #if !defined(__APPLE__ )
5053void nullPointer_mq_timedsend (mqd_t mqdes , const char * msg_ptr , size_t msg_len , unsigned msg_prio , const struct timespec * abs_timeout ) {
5154 // cppcheck-suppress nullPointer
5255 (void ) mq_timedsend (mqdes , NULL , msg_len , msg_prio , abs_timeout );
@@ -144,6 +147,7 @@ void nullPointer_pthread_attr_setstack(const pthread_attr_t *attr) {
144147 (void ) pthread_attr_setstack (NULL , (void * ) 1 , 0 );
145148}
146149
150+ #ifndef __linux__
147151void nullPointer_setkey (const char * key )
148152{
149153 // cppcheck-suppress nullPointer
@@ -156,6 +160,7 @@ void nullPointer_encrypt(const char block[64], int edflag)
156160 encrypt (NULL , edflag );
157161 encrypt (block , edflag );
158162}
163+ #endif
159164
160165int nullPointer_getopt (int argc , char * const argv [], const char * optstring )
161166{
@@ -166,7 +171,7 @@ int nullPointer_getopt(int argc, char* const argv[], const char* optstring)
166171 return getopt (argc , argv , optstring );
167172}
168173
169- #if !( defined(__APPLE__ ) && defined( __MACH__ ) )
174+ #if !defined(__APPLE__ )
170175int invalidFunctionArgStr_mq_send (mqd_t mqdes , const char * msg_ptr , size_t msg_len , unsigned msg_prio )
171176{
172177 // No warning is expected for:
@@ -532,7 +537,7 @@ int nullPointer_aio_suspend(const struct aiocb *const aiocb_list[], int nitems,
532537 return aio_suspend (aiocb_list , nitems , timeout );
533538}
534539
535- #ifdef __linux__
540+ #if !defined( __linux__ ) && !defined( __APPLE__ )
536541// Note: Since glibc 2.28, this function symbol is no longer available to newly linked applications.
537542void invalidFunctionArg_llseek (int fd , loff_t offset , int origin )
538543{
@@ -563,7 +568,6 @@ void invalidFunctionArg_llseek(int fd, loff_t offset, int origin)
563568 // cppcheck-suppress llseekCalled
564569 (void )llseek (fd , offset , SEEK_END );
565570}
566- #endif
567571
568572void invalidFunctionArg_lseek64 (int fd , off_t offset , int origin )
569573{
@@ -584,6 +588,7 @@ void invalidFunctionArg_lseek64(int fd, off_t offset, int origin)
584588 (void )lseek64 (fd , offset , SEEK_CUR );
585589 (void )lseek64 (fd , offset , SEEK_END );
586590}
591+ #endif
587592
588593void invalidFunctionArg_lseek (int fd , off_t offset , int origin )
589594{
@@ -1328,7 +1333,7 @@ void uninitvar(int fd)
13281333 // cppcheck-suppress utimeCalled
13291334 utime (filename1 , times );
13301335 // cppcheck-suppress constVariable
1331- struct timeval times1 [2 ];
1336+ struct utimbuf times1 [2 ];
13321337 // cppcheck-suppress uninitvar
13331338 // cppcheck-suppress utimeCalled
13341339 utime (filename2 , times1 );
0 commit comments