WIFEXITED combined with WIFSIGNALED I am testing the WIFEXITED to see if a child process exited abnormally or normally. According to documentation, it should return a non-zero status for a child process that terminated normally.

#include &lt;wait.h&gt;
#include &lt;unistd.h&gt;
#include &lt;iostream&gt;
#include &lt;sys/types.h&gt;

int main(int argc, const char* const* argv) {
    int *pointer=NULL;
    int status;
    pid_t pid=fork();
    if (pid==0) {
        std::cout &lt;&lt; "Child is: " &lt;&lt; getpid() &lt;&lt; std::endl;
        if (argc&gt;1) {
            std::cout &lt;&lt; getpid() &lt;&lt; "Going to crash myself" &lt;&lt; std::endl;
            *pointer=1; //Segmentation fault as of null pointer dereference
        }
        else
            pointer=NULL; //Safe code
    }
    else {
        std::cout &lt;&lt; "Parent is: " &lt;&lt; getpid() &lt;&lt; std::endl;
        pid_t terminated=waitpid(-1, &amp;status, 0);
        std::cout &lt;&lt; "Child " &lt;&lt; terminated &lt;&lt; " exited ";
        if (WIFEXITED(status)) std::cout &lt;&lt; "GOOD";
        else {
             std::cout &lt;&lt; "BAD";
             // Is it worth here to also check for WIFSIGNALED or is it redundant?
        }
        std::cout &lt;&lt; std::endl;
    }
    std::cout &lt;&lt; getpid() &lt;&lt; " exiting normally" &lt;&lt; std::endl;
    return 0;
}


To test a normal exit, call it without arguments, and an abnormal exit with segmentation fault, call it with some parameters.

Furthermore, if I use WIFSIGNALED it detects correctly the bad status, then, what's the use for WIFEXITED?

Is it advisable to use only WIFEXITED, or do you advise also to use WIFSIGNALED for further checks? Is this combination useful or redundant?
WIFSIGNALED / WIFSTOPPED
If you get into the &quot;BAD&quot; case, you may want to check whether WIFSIGNALED is true or WIFSTOPPED is true.  WIFSIGNALED tells you if the program terminated with a signal (such as segv).  WIFSTOPPED tells you if the program is currently stopped (but not terminated).
If your child process can never be stopped, then you can assume that it terminated abnormally and not bother checking those macros.  In your particular example, your child will either segfault or exit right away, so it's unlikely that someone would be able to kill -STOP your process before it crashed.