@@ -57,6 +57,7 @@ int deallocuse_backtrace(int size) {
5757 return numEntries ;
5858}
5959
60+ #if !defined(__APPLE__ )
6061void leakReturnValNotUsed_get_current_dir_name (void )
6162{
6263 // cppcheck-suppress leakReturnValNotUsed
@@ -113,7 +114,6 @@ int nullPointer_gethostbyname_r(const char* name, struct hostent* ret, const cha
113114 return gethostbyname_r (name , ret , buf , buflen , result , h_errnop );
114115}
115116
116-
117117int nullPointer_gethostbyaddr_r (const void * addr , socklen_t len , int type , struct hostent * ret , const char * buf , size_t buflen , struct hostent * * result , const int * h_errnop )
118118{
119119 // cppcheck-suppress nullPointer
@@ -128,6 +128,7 @@ int nullPointer_gethostbyaddr_r(const void* addr, socklen_t len, int type, struc
128128 (void ) gethostbyaddr_r (addr , len , type , ret , buf , buflen , result , NULL );
129129 return gethostbyaddr_r (addr , len , type , ret , buf , buflen , result , h_errnop );
130130}
131+ #endif
131132
132133int nullPointer_getopt_long (int argc , char * * argv , const char * optstring ,
133134 const struct option * longopts , int * longindex )
@@ -153,6 +154,7 @@ int nullPointer_getopt_long_only(int argc, char* const* argv, const char* optstr
153154 return getopt_long_only (argc , argv , optstring , longopts , longindex );
154155}
155156
157+ #if !defined(__APPLE__ )
156158int nullPointer_getservent_r (struct servent * restrict result_buf , const char * restrict buf , size_t buflen , struct servent * * restrict result )
157159{
158160 // cppcheck-suppress nullPointer
@@ -172,6 +174,7 @@ void *bufferAccessOutOfBounds_memrchr(const void *s, int c, size_t n)
172174 (void )memrchr (buf ,c ,43 );
173175 return memrchr (s ,c ,n );
174176}
177+ #endif
175178
176179void knownConditionTrueFalse_ffsl (long i )
177180{
@@ -191,6 +194,7 @@ void knownConditionTrueFalse_ffsll(long long i)
191194 if (ffsll (i ) == 0 ) {}
192195}
193196
197+ #if !defined(__APPLE__ )
194198int nullPointer_semtimedop (int semid , struct sembuf * sops , size_t nsops , const struct timespec * timeout )
195199{
196200 (void ) semtimedop (semid , sops , nsops , NULL ); // If the timeout argument is NULL, then semtimedop() behaves exactly like semop().
@@ -226,8 +230,10 @@ int uninitvar_getpw(uid_t uid, char *buf)
226230 // cppcheck-suppress uninitvar
227231 return getpw (someUid , buf );
228232}
233+ #endif
229234
230235// Declaration necessary because there is no specific / portable header.
236+ // https://www.eyrie.org/~eagle/software/rra-c-util/xmalloc.html
231237extern void * xcalloc (size_t nmemb , size_t size );
232238extern void * xmalloc (size_t size );
233239extern void * xrealloc (void * block , size_t newsize );
@@ -293,8 +299,10 @@ void valid_code(int argInt1, va_list valist_arg, const int * parg)
293299
294300 if (__builtin_expect (argInt1 , 0 )) {}
295301 if (__builtin_expect_with_probability (argInt1 + 1 , 2 , 0.5 )) {}
302+ #ifdef __GLIBC__
296303 if (__glibc_unlikely (argInt1 != 0 )) {}
297304 if (__glibc_likely (parg != NULL )) {}
305+ #endif
298306 const void * ax1 = __builtin_assume_aligned (parg , 16 );
299307 printf ("%p" , ax1 );
300308 const void * ax2 = __builtin_assume_aligned (parg , 32 , 8 );
@@ -482,6 +490,7 @@ void bufferAccessOutOfBounds()
482490 free (pAlloc2 );
483491}
484492
493+ #if !defined(__APPLE__ )
485494void leakReturnValNotUsed ()
486495{
487496 // cppcheck-suppress [unreadVariable, constVariablePointer]
@@ -501,6 +510,7 @@ void leakReturnValNotUsed()
501510 if (42 == __builtin_expect (42 , 0 ))
502511 return ;
503512}
513+ #endif
504514
505515#if !defined(__CYGWIN__ ) && !defined(__APPLE__ )
506516int nullPointer_epoll_ctl (int epfd , int op , int fd , struct epoll_event * event )
0 commit comments