summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-01-25 18:35:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-25 21:28:34 (GMT)
commit94d3997ecc09f36d17b9ad4b49c4709885e300f7 (patch)
treed6bcd4fdbb67fb4876f084adba9c7390c9aed114
parent019678d6b1f83419cdc35e3d455175adce3a379c (diff)
downloadgit-94d3997ecc09f36d17b9ad4b49c4709885e300f7.zip
git-94d3997ecc09f36d17b9ad4b49c4709885e300f7.tar.gz
git-94d3997ecc09f36d17b9ad4b49c4709885e300f7.tar.bz2
difftool: hack around -Wzero-length-format warning
Building with "gcc -Wall" will complain that the format in: warning("") is empty. Which is true, but the warning is over-eager. We are calling the function for its side effect of printing "warning:", even with an empty string. Our DEVELOPER Makefile knob disables the warning, but not everybody uses it. Let's silence the warning in the code so that nobody reports it or tries to "fix" it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/difftool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 42ad9e8..b5e85ab 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -567,7 +567,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
warning(_("both files modified: '%s' and '%s'."),
wtdir.buf, rdir.buf);
warning(_("working tree file has been left."));
- warning("");
+ warning("%s", "");
err = 1;
} else if (unlink(wtdir.buf) ||
copy_file(wtdir.buf, rdir.buf, st.st_mode))