From 94d3997ecc09f36d17b9ad4b49c4709885e300f7 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 25 Jan 2017 13:35:42 -0500 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- builtin/difftool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/difftool.c b/builtin/difftool.c index 42ad9e804a..b5e85ab079 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)) -- 2.11.4.GIT