Re: [PATCH 3/3] Silence a bunch of format-zero-length warnings
- From
Jeff King <peff@peff.net>
- Date
- May 5, 2014, 05:21 UTC
- Message-ID
- <20140505052117.GC6569@sigill.intra.peff.net>
- In-Reply-To
- <20140504190121.GP75770@vauxhall.crustytoothpaste.net>
On Sun, May 04, 2014 at 07:01:22PM +0000, brian m. carlson wrote:
Show 13 quoted lines
> On Sun, May 04, 2014 at 01:12:55AM -0500, Felipe Contreras wrote: > > This is in gcc 4.9.0: > > > > wt-status.c: In function ‘wt_status_print_unmerged_header’: > > wt-status.c:191:2: warning: zero-length gnu_printf format string [-Wformat-zero-length] > > status_printf_ln(s, c, ""); > > ^ > > > > We could pass -Wno-format-zero-length, but it seems compiler-specific > > flags are frowned upon, so let's just avoid the warning altogether. > > I believe these warnings existed before GCC 4.9 as well, but I'm not > opposed to the change.
Yeah, this started last summer when we added __attribute__((format)) to the status_printf_ln calls, and I posted essentially the same patch. We kind of waffled between "eh, just set -Wno-format-zero-length" and doing something, and ended up at the former. I'd be fine with doing it this way; we're not likely to add a lot of new callsites that would make it a hassle to keep up with.
-Peff