Re: [PATCH 3/3] wt-status: use "format" function attribute for status_printf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> On Tue, Jul 09, 2013 at 10:35:25PM -0700, Junio C Hamano wrote:
>
>> > 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.
>
> I imagine that is the method intended by upstream (though who
> knows...the whole warning seems kind of stupid to me; it is clear that
> printf("") is a no-op, but it is obviously not clear that arbitrary
> functions using __attribute__(format) are).
>
> The patch to do it is below, but I actually think an explicit blank-line
> function like:
>
>   status_print_empty_line(s, color);
>
> would be more obvious to a reader.

I noticed that all but one can be dealt with with

    perl -p -i -e 's/status_printf_ln\((.*), ""\);/status_printf($1, "\\n");/'

That is,

-	status_printf_ln(s, GIT_COLOR_NORMAL, "");
+	status_printf(s, GIT_COLOR_NORMAL, "\n");

which does not look _too_ bad.

There is one instance that needs this, though.

-		status_printf(s, color(WT_STATUS_HEADER, s), "");
+		status_printf(s, color(WT_STATUS_HEADER, s), "%s", "");

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]