Warning for unadorned 0 in varargs lists?

Marc Espie espie@quatramaran.ens.fr
Sun Aug 22 20:35:00 GMT 2004


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...



More information about the Gcc mailing list