根據exec reference,對exec(或通常的堆棧檢查可變參數函數)的調用需要參數列表末尾的(char*)NULL
aka 0。然而,GCC抱怨以下代碼沒有足夠的變量來適應哨兵
char cmdFullPath[4096]; //yes this 4096 thing is bad coding practice
...
execl(cmdFullPath, (char*)NULL);
//warning: not enough variable arguments to fit a sentinel
任何人都知道什麼是錯的?
可能重複:http://stackoverflow.com/questions/2050961/is-argv0-name-of-executable-an-accepted-standard-or-just-a-common-conventio – 2010-09-28 20:40:22