@@ -58,6 +58,7 @@ int deallocuse_backtrace(int size) {
5858 return numEntries ;
5959}
6060
61+ #if !defined(__APPLE__ )
6162void leakReturnValNotUsed_get_current_dir_name (void )
6263{
6364 // cppcheck-suppress leakReturnValNotUsed
@@ -114,7 +115,6 @@ int nullPointer_gethostbyname_r(const char* name, struct hostent* ret, const cha
114115 return gethostbyname_r (name , ret , buf , buflen , result , h_errnop );
115116}
116117
117-
118118int 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 )
119119{
120120 // cppcheck-suppress nullPointer
@@ -129,6 +129,7 @@ int nullPointer_gethostbyaddr_r(const void* addr, socklen_t len, int type, struc
129129 (void ) gethostbyaddr_r (addr , len , type , ret , buf , buflen , result , NULL );
130130 return gethostbyaddr_r (addr , len , type , ret , buf , buflen , result , h_errnop );
131131}
132+ #endif
132133
133134int nullPointer_getopt_long (int argc , char * * argv , const char * optstring ,
134135 const struct option * longopts , int * longindex )
@@ -154,6 +155,7 @@ int nullPointer_getopt_long_only(int argc, char* const* argv, const char* optstr
154155 return getopt_long_only (argc , argv , optstring , longopts , longindex );
155156}
156157
158+ #if !defined(__APPLE__ )
157159int nullPointer_getservent_r (struct servent * restrict result_buf , const char * restrict buf , size_t buflen , struct servent * * restrict result )
158160{
159161 // cppcheck-suppress nullPointer
@@ -173,6 +175,7 @@ void *bufferAccessOutOfBounds_memrchr(const void *s, int c, size_t n)
173175 (void )memrchr (buf ,c ,43 );
174176 return memrchr (s ,c ,n );
175177}
178+ #endif
176179
177180void knownConditionTrueFalse_ffsl (long i )
178181{
@@ -192,6 +195,7 @@ void knownConditionTrueFalse_ffsll(long long i)
192195 if (ffsll (i ) == 0 ) {}
193196}
194197
198+ #if !defined(__APPLE__ )
195199int nullPointer_semtimedop (int semid , struct sembuf * sops , size_t nsops , const struct timespec * timeout )
196200{
197201 (void ) semtimedop (semid , sops , nsops , NULL ); // If the timeout argument is NULL, then semtimedop() behaves exactly like semop().
@@ -227,8 +231,10 @@ int uninitvar_getpw(uid_t uid, char *buf)
227231 // cppcheck-suppress uninitvar
228232 return getpw (someUid , buf );
229233}
234+ #endif
230235
231236// Declaration necessary because there is no specific / portable header.
237+ // https://www.eyrie.org/~eagle/software/rra-c-util/xmalloc.html
232238extern void * xcalloc (size_t nmemb , size_t size );
233239extern void * xmalloc (size_t size );
234240extern void * xrealloc (void * block , size_t newsize );
@@ -294,8 +300,10 @@ void valid_code(int argInt1, va_list valist_arg, const int * parg)
294300
295301 if (__builtin_expect (argInt1 , 0 )) {}
296302 if (__builtin_expect_with_probability (argInt1 + 1 , 2 , 0.5 )) {}
303+ #ifdef __GLIBC__
297304 if (__glibc_unlikely (argInt1 != 0 )) {}
298305 if (__glibc_likely (parg != NULL )) {}
306+ #endif
299307 const void * ax1 = __builtin_assume_aligned (parg , 16 );
300308 printf ("%p" , ax1 );
301309 const void * ax2 = __builtin_assume_aligned (parg , 32 , 8 );
@@ -489,6 +497,7 @@ void bufferAccessOutOfBounds()
489497 free (pAlloc2 );
490498}
491499
500+ #if !defined(__APPLE__ )
492501void leakReturnValNotUsed ()
493502{
494503 // cppcheck-suppress [unreadVariable, constVariablePointer]
@@ -508,6 +517,7 @@ void leakReturnValNotUsed()
508517 if (42 == __builtin_expect (42 , 0 ))
509518 return ;
510519}
520+ #endif
511521
512522#if !defined(__CYGWIN__ ) && !defined(__APPLE__ )
513523int nullPointer_epoll_ctl (int epfd , int op , int fd , struct epoll_event * event )
0 commit comments