This compiles without errors?

int CHILD_STAT;
...
wait_child(child_pid,CHILD_STAT);
...
int wait_child(pid_t wait_pid, int *child_status)

As in, the function expects a POINTER, and you don't pass one.