Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: gnusrc/gnu/libexec/uucp
On Thu, May 30, 2002 at 06:02:14PM +0000, Christos Zoulas wrote:
> Well, I've been watching this format-zero-length thingy for a while,
> and it occured to me that we are going the wrong way about this.
>
> It really should not be a compiler flag, but an attribute. What
> happens if you turn -Wno-format-zero-length on, and then you
> have a function that does not allow zero format and you want to
> check it?
>
> I suggest something:
>
> __attribute__((__format__(__printf__,m,n[,
> __nullformat__[,__emptyformat__]])));
>
> to show that a function allows null and/or empty format strings.
I'll take this up with the GCC folks. I expect to get pushback on it.
I'd also have to think about how it might be implemented.
Note I implemented the "__nullformat__" thing in gcc-current .. it's generic
null argument checking ... you specify that an argument is to be non-null
like:
void my_memcpy(void *dst, const void *src, size_t len)
__attribute__((__nonnull__(1,2)));
..and the printf, etc. built-ins have nonnull attributes chained to the
format attributes.
--
-- Jason R. Thorpe <thorpej%wasabisystems.com@localhost>
Home |
Main Index |
Thread Index |
Old Index