This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18886] New: attribute sentinel doesn't work with C++
- From: "salinger at sun dot felk dot cvut dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Dec 2004 10:44:32 -0000
- Subject: [Bug c++/18886] New: attribute sentinel doesn't work with C++
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
NULL is expanded as __null in C++.
This is inconsistent with sentinel testing.
There should be one warning for both cases.
gcc version 4.0.0 20041128 (experimental)
$ gcc -Wall -c e.c
e.c: In function 'bar':
e.c:15: warning: missing sentinel in function call
$ g++ -Wall -c e.c
e.c: In function 'void bar()':
e.c:15: warning: missing sentinel in function call
e.c:16: warning: missing sentinel in function call
e,c:
#include <stddef.h> /* For NULL */
#ifdef __cplusplus
extern "C" {
#endif
extern int execl (const char *, const char *, ...);
#ifdef __cplusplus
} /* C++ */
#endif
void bar(void)
{
execl ("/bin/ls", "-aFC");
execl ("/bin/ls", "-aFC", NULL);
}
--
Summary: attribute sentinel doesn't work with C++
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: salinger at sun dot felk dot cvut dot cz
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i486-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18886