warning: missing sentinel in function call
warning: missing sentinel in function call
因為NULL不是一個正確的字元結束( terminated )資料型態,所以就會產生warning: missing sentinel in function call
#include
int main() {
execl("/bin/ls", "ls", "-l", NULL);
return 0;
}
為了要避險這樣的情形產生。
#include
int main() {
execl("/bin/ls", "ls", "-l", (char *)NULL);
return 0;
}
這樣gcc就不會產生
warning: missing sentinel in function call
留言
張貼留言