This is the mail archive of the gcc@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]

Re: Warning for unadorned 0 in varargs lists?


In article <87oel63c8q.fsf@deneb.enyo.de> you write:
>* Joe Buck:
>
>> A warning would make sense if, rather than warning for all varargs
>> functions, the user only gets a warning for functions that definitely
>> expect pointers: execl, for example.  It might be better to do this with
>> something like the format-checking attributes supported for printf-like
>> functions: that is, an attribute that says a varargs function's variable
>> arguments are all pointers, or something like that.
>
>"null terminated pointer list", probably.  This would also catch the
>case where the terminating NULL pointer has been omitted.

That's exactly what the attribute((sentinel)) construct we added in
OpenBSD does.

I just haven't had time to port it over to gcc-current, as the
implementation we use is for gcc 2.95 or gcc 3.3...


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