Jeff King <p...@peff.net> writes:

> On Tue, Jul 09, 2013 at 10:26:04PM -0700, Junio C Hamano wrote:
>
>> Jeff King <p...@peff.net> writes:
>> 
>> > These functions could benefit from the added compile-time
>> > safety of having the compiler check printf arguments.
>> >
>> > Unfortunately, we also sometimes pass an empty format string,
>> > which will cause false positives with -Wformat-zero-length.
>> > In this case, that warning is wrong because our function is
>> > not a no-op with an empty format: it may be printing
>> > colorized output along with a trailing newline.
>> >
>> > Signed-off-by: Jeff King <p...@peff.net>
>> > ---
>> > I'm torn on this one. It really does provide us with more compile-time
>> > safety checks, but it's annoying that "-Wall -Werror" will no longer
>> > work out of the box.
>> 
>> Yeah, that is a show-stopper for me X-<.
>
> You can "fix" it with -Wno-zero-format-length, so the hassle is not
> huge. 

Yes, or just do func(..., "%s", "") perhaps?  That also sound iffy.

> But I am also inclined to just drop this one. We have lived
> without the extra safety for a long time, and list review does tend to
> catch such problems in practice.
>
> -Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to