Some questions tackle with this problem for general instances; however, in this case, all I see is just a value returned by a function. See by yourself:
The third line, (void) signal (SIGALRM, myAlarm);
is supposed to execute the system call signal
, which - if I understood correctly - returns a pointer to a function.
Being it the general case, I can see why a function pointer is being cast to void
; however, apart from C's implicit casting, that line itself does exactly nothing to the returned value "in memory" as it's simply a value.
Am I missing something? Does (void)
actually do anything in the third line (and for the rest of the program)? Even if the function pointer were to be of a different type than void, wouldn't the third line act only on the returned value, instead of a (hypothetically) stored one? In a few words, is it necessary or is it a redundancy?