git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] fix status_printf_ln calls "zero-length format" warnings

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2014, 19:25 UTC
Message-ID
<xmqq38ior0zq.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140310195121.GB24568@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> Most of us who compile with -Wall decided a while ago to use
> -Wno-format-zero-length, because it really is a silly complaint (it
> assumes there are no side effects of the function besides printing the
> format string, which is obviously not true in this case).
>
> It would be nice to compile out of the box with "-Wall -Werror", and I
> think your solution looks relatively clean. But I am slightly concerned
> about the assumption that it is OK to pass a NULL fmt parameter to a
> function marked with __attribute__((format)).  It certainly seems to be
> the case now, and I do not know of any plans for that to change, but it
> seems like a potentially obvious thing for the compiler to check.
Yes, exactly.
Previous: Jeff King
Message 6 of 6 in “fix status_printf_ln calls "zero-length format" warnings”
  1. 0/2 fix status_printf_ln calls "zero-length format" warningsBenoit Pierre, Mar 10, 2014
  2. 1/2 status: allow NULL fmt for status_printf/status_vprintf_lnBenoit Pierre, Mar 10, 2014
  3. Eric SunshineMar 10, 2014
  4. 2/2 fix status_printf_ln calls "zero-length format" warningsBenoit Pierre, Mar 10, 2014
  5. Jeff KingMar 10, 2014
  6. Junio C HamanoMar 11, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.