git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Alban Gruin <alban.gruin@gmail.com>
Cc: Ralf Thielow via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Ralf Thielow <ralf.thielow@gmail.com>,
	Jeff King <peff@peff.net>
Subject: Re: [PATCH] rebase-interactive.c: silence format-zero-length warnings
Date: Tue, 03 Mar 2020 06:20:32 -0800	[thread overview]
Message-ID: <xmqqh7z5a5an.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <87196142-8473-7d19-4edd-7452eaefda1c@gmail.com> (Alban Gruin's message of "Tue, 3 Mar 2020 11:17:46 +0100")

Alban Gruin <alban.gruin@gmail.com> writes:

>> Fixes the following warnings:
>> 
>> rebase-interactive.c: In function ‘edit_todo_list’:
>> rebase-interactive.c:137:38: warning: zero-length gnu_printf format string [-Wformat-zero-length]
>>     write_file(rebase_path_dropped(), "");
>> rebase-interactive.c:144:37: warning: zero-length gnu_printf format string [-Wformat-zero-length]
> ...
> On a tangent: what's wrong with empty format strings?

Those functions that are truly printf-like, such a call would be
no-op and an indication of possible typo ("did you forget a %s or
something?"), I presume.

But many of our functions that take printf-like format strings will
do useful things even when an empty string is given, so the warning
is unwanted.

      reply	other threads:[~2020-03-03 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 20:25 [PATCH] rebase-interactive.c: silence format-zero-length warnings Ralf Thielow via GitGitGadget
2020-02-27 23:54 ` [PATCH] config.mak.dev: re-enable -Wformat-zero-length Jeff King
2020-02-28 16:42   ` Junio C Hamano
2020-02-28 17:06     ` Jeff King
2020-03-03 10:17 ` [PATCH] rebase-interactive.c: silence format-zero-length warnings Alban Gruin
2020-03-03 14:20   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqh7z5a5an.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=alban.gruin@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=peff@peff.net \
    --cc=ralf.thielow@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).