I just found this.
// /usr/include/sys/signal.h // OS X
#define SIG_ERR ((void (*)(int))-1)
What does ((void (*)(int))-1) part mean?
Is it different to
#define SIG_ERR -1
?
This is cast to a function-pointer:
((type) value)
Where type is void (*)(int) which is pointer to function accepting one int argument and returning void, which is actually is a signature of a signal handler:
typedef void (*sighandler_t)(int);
You may decode such types with cdecl tool or web-site: http://cdecl.org/
This is a cast of -1 into the function pointer which is expected as the type of SIG_ERR. Using -1 directly does not work at situations where the compiler needs the correct type.