https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92667
Bug ID: 92667 Summary: spurious missing sentinel in function call with a local sentinel variable Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- While looking into bug 92666 I noticed the following false positive in C (it can be reproduced in C++ making the pointer non-const so it doesn't get folded). By being implemented fully in the front-end the warning doesn't see that the nullptr variable is, in fact, a null pointer. $ cat t.c && cat t.c && gcc -S -Wall t.c void f (void) { const char* const null = 0; __builtin_execl ("foo", "bar", null); } void f (void) { const char* const null = 0; __builtin_execl ("foo", "bar", null); } t.c: In function âfâ: t.c:5:3: warning: missing sentinel in function call [-Wformat=] 5 | __builtin_execl ("foo", "bar", null); | ^~~~~~~~~~~~~~~