cc -pthread -Wall -Wextra -Werror -Wno-error=deprecated -Wno-error=deprecated-declarations semaphore/sem_timedwait.c -o semaphore/sem_timedwait -D_POSIX_C_SOURCE=202405L -lm -lpthread -liconv semaphore/sem_timedwait.c:5:64: error: use of undeclared identifier 'sem_timedwait'; did you mean 'sem_trywait'? 5 | int (*foo)(sem_t *restrict, const struct timespec *restrict) = sem_timedwait; | ^~~~~~~~~~~~~ | sem_trywait /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/semaphore.h:58:5: note: 'sem_trywait' declared here 58 | int sem_trywait(sem_t *); | ^ semaphore/sem_timedwait.c:5:7: error: incompatible function pointer types initializing 'int (*)(sem_t *restrict, const struct timespec *restrict)' (aka 'int (*)(int *restrict, const struct timespec *restrict)') with an expression of type 'int (sem_t *)' (aka 'int (int *)') [-Wincompatible-function-pointer-types] 5 | int (*foo)(sem_t *restrict, const struct timespec *restrict) = sem_timedwait; | ^ ~~~~~~~~~~~~~ 2 errors generated.