This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21911] New: named parameter mistakenly identified as sentinel
- From: "ghazi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jun 2005 12:46:24 -0000
- Subject: [Bug c/21911] New: named parameter mistakenly identified as sentinel
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
GCC mistakenly identifies a named parameter as a sentinel. Given the following
program, compiling with -Wformat GCC should warn about a missing sentinel on
the line indicated:
#include <stddef.h>
extern void foo (const char *, ...) __attribute__ ((__sentinel__));
void bar (void)
{
foo (NULL); /* missing warning!! */
foo ("hello", NULL); /* clean */
}
When looking for the sentinel, GCC should skip over the named arguments first
before attempting to locate the NULL pointer.
--
Summary: named parameter mistakenly identified as sentinel
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ghazi at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21911