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

Re: [PATCH] config.mak.dev: re-enable -Wformat-zero-length

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 28, 2020, 16:42 UTC
Message-ID
<xmqqtv3aek8o.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20200227235445.GA1371170@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> The short of it is that we probably can't just disable the warning for
> everybody because of portability issues. And ignoring it for developers
> puts us in the situation we're in now, where non-dev builds are annoyed.

"git blame" unfortunately is very bad at poing at a commit that removed something, so I do not offhand know how much it would help readers who later wonder "oh, I am sure we had thing to disable format-zero-length warning, and I want to learn the reason why we dropped it", but thanks for writing this down.

Show 25 quoted lines
> Since the workaround is both rarely needed and fairly straight-forward,
> let's just commit to doing it as necessary, and re-enable the warning.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> I had totally forgotten about that thread until researching the history
> just now. There's another option there involving #pragma, but it was too
> gross for me to even suggest now as an alternative in the commit
> message. ;) I think this is the most practical improvement.
>
>  config.mak.dev | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/config.mak.dev b/config.mak.dev
> index bf1f3fcdee..89b218d11a 100644
> --- a/config.mak.dev
> +++ b/config.mak.dev
> @@ -9,7 +9,6 @@ endif
>  DEVELOPER_CFLAGS += -Wall
>  DEVELOPER_CFLAGS += -Wdeclaration-after-statement
>  DEVELOPER_CFLAGS += -Wformat-security
> -DEVELOPER_CFLAGS += -Wno-format-zero-length
>  DEVELOPER_CFLAGS += -Wold-style-definition
>  DEVELOPER_CFLAGS += -Woverflow
>  DEVELOPER_CFLAGS += -Wpointer-arith
Previous: Jeff KingNext: Jeff King
Message 3 of 6 in “rebase-interactive.c: silence format-zero-length warnings”
  1. rebase-interactive.c: silence format-zero-length warningsRalf Thielow via GitGitGadget, Feb 27, 2020
  2. config.mak.dev: re-enable -Wformat-zero-lengthJeff King, Feb 27, 2020
  3. Junio C HamanoFeb 28, 2020
  4. Jeff KingFeb 28, 2020
  5. Alban GruinMar 3, 2020
  6. Junio C HamanoMar 3, 2020

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.