Skip to content

Commit 94d3997

Browse files
peffgitster
authored andcommitted
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>
1 parent 019678d commit 94d3997

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/difftool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
567567
warning(_("both files modified: '%s' and '%s'."),
568568
wtdir.buf, rdir.buf);
569569
warning(_("working tree file has been left."));
570-
warning("");
570+
warning("%s", "");
571571
err = 1;
572572
} else if (unlink(wtdir.buf) ||
573573
copy_file(wtdir.buf, rdir.buf, st.st_mode))

0 commit comments

Comments
 (0)