如何在不获取编译警告的情况下表达wait(NULL)?

Nik*_*ntz 2 c gcc gcc-warning

如果我编译我的程序cc然后它的工作原理.但我必须使用编译gcc -pedantic -Wall -ansi -O4.然后我收到了声明的警告wait(NULL)

miniShell.c: In function ‘main’:
miniShell.c:84:13: warning: implicit declaration of function ‘wait’ [-Wimplicit-function-declaration]
             wait(NULL);
             ^
Run Code Online (Sandbox Code Playgroud)

我可以重写它以取悦编译器吗?

pas*_*pkT 9

Linux程序员手册:

WAIT(2)                    Linux Programmer's Manual                   WAIT(2)

NAME
       wait, waitpid, waitid - wait for process to change state

SYNOPSIS
       #include <sys/types.h>
       #include <sys/wait.h>

       pid_t wait(int *status);
Run Code Online (Sandbox Code Playgroud)

所以添加这两个#includes来使用wait().