I'm analyzing a C program in which I find a strange fucntion call here is the function definition :
static void endSignal (int32_t dummy) { if (nTerminating) return; nTerminating=1; printf("terminating....\n"); terminateDLNAsystem(); sleep(1); exit (0); } This function takes an int32_t parameter ! Now this the main function calling "endSignal"
int32_t main (int32_t argc, char **argv) { /*Statements . . */ signal(SIGINT, endSignal); signal(SIGABRT, endSignal); signal(SIGQUIT, endSignal); signal(SIGTERM, endSignal); return 0; } the main function call endSignal without any parameter, what happen in this case ?
endSignal, it passes the function as a parameter to another function.mainprototype is not standard-conforming, BTW;mainshould returnintand the first argument should beint; this in your question is an "other implementation defined manner".