This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/18886] New: attribute sentinel doesn't work with C++


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]