Here's the definition of macros defined in signal.h according to ISO C N2176_C17_finaldraft document 7.14.3:
The Macros defined are:
SIG_DFL
SIG_ERR
SIG_IGNwhich expand to constant expressions with distinct values that have type compatible with the second argument to, and the return value of, the 'signal' function, and whose values compare unequal to the address of any declarable function; and the following, which expand to positive integer constant expressions with type 'int' and distinct values that are the signal numbers, each corresponding to the specified condition:
SIGABRT -> abnormal termination, such as is initiated by the abort function
SIGFPE -> an erroneous arithmetic operation, such as zero divide or an operation resulting in overflow
SIGILL -> detection of an invalid function image, such as an invalid instruction
SIGINT -> Receipt of an interactive attention signal
SIGSEGV -> an invalid access to storage
SIGTERM -> a termination request sent to the program
Here, there are three important statements regarding macros defined in signal.h:
"expand to constant expressions with distinct values that have type compatible with the second argument to, and the return value of, the 'signal' function".
My understanding: These macros are replaced by a value which has the type
void (*)(int)
, i.e., an address to a function: which takes anint
as argument and has return type similar to the return type ofsignal
function, i.e.,void
."whose values compare unequal to the address of any declarable function".
My understanding: The address to a function returned by these Macros is not equal to any declarable function. But I'm not sure what exactly is a Declarable function.
"the following, which expand to positive integer constant expressions with type 'int' and distinct values that are the signal numbers".
My understanding: I don't understand this.