1
26: execve(prog[0],prog,env);
27: return 0; 


execve() does not return on success, and  the  text,  data,  bss,  and
       stack  of  the  calling process are overwritten by that of the program
       loaded.

何のreturn 0;ために?

4

2 に答える 2

1

このコンパイラの警告をやめることをお勧めします。

$ cat | gcc -W -Wall -x c -
int main(){}
^D
<stdin>: In function 'main':
<stdin>:1:1: warning: control reaches end of non-void function

これにより、静的アナライザーとIDEの同じことに関する警告も表示されます。

于 2011-04-16T21:12:39.707 に答える