[Bug c/67093] incorrect -Wnonnull text for execl family of functions
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Aug 3 16:15:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67093
--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
execl is a GCC builtin and GCC issues the -Wformat warning regardless of its
declaration:
$ cat t.c && ~/bin/gcc-5.1.0/bin/gcc -Wall t.c
extern int execl (const char*, const char*, ...);
int main (void) {
return execl ("/bin/echo", (char*)0);
}
t.c: In function ‘main’:
t.c:4:5: warning: not enough variable arguments to fit a sentinel [-Wformat=]
return execl ("/bin/echo", (char*)0);
^
You're right though that the -Wnonnull warning is due to the nonnull attribute.
More information about the Gcc-bugs
mailing list