warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__pid_t (*)(void)’

代码如下
printf("%d pid : ppid :%d %d\n",s*s,getpid,getppid;

错误如下
warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__pid_t (*)(void)’
格式’%d’需要类型为’int’的参数,但参数3的类型为’__pid_t(*)(void)’[ - Wformat]

也就是在需要传入参数返回值的时候很重要的一件事,一定要加上括号。
加上括号就是取返回值,不加括号就是一个函数。

正确改为
printf("%d pid : ppid :%d %d\n",s*s,getpid(),getppid());

warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__pid_t (*)(void)’
开心一点,人间不值得。