Skip to content

Commit 7329d94

Browse files
peffgitster
authored andcommitted
config.mak.dev: re-enable -Wformat-zero-length
We recently triggered some -Wformat-zero-length warnings in the code, but no developers noticed because we suppress that warning in builds with the DEVELOPER=1 Makefile knob set. But we _don't_ suppress them in a non-developer build (and they're part of -Wall). So even though non-developers probably aren't using -Werror, they see the annoying warnings when they build. We've had back and forth discussion over the years on whether this warning is useful or not. In most cases we've seen, it's not true that the call is a mistake, since we're using its side effects (like adding a newline status_printf_ln()) or writing an empty string to a destination which is handled by the function (as in write_file()). And so we end up working around it in the source by passing ("%s", ""). There's more discussion in the subthread starting at: https://lore.kernel.org/git/[email protected]/ 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. 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7daf4f2 commit 7329d94

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

config.mak.dev

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ endif
99
DEVELOPER_CFLAGS += -Wall
1010
DEVELOPER_CFLAGS += -Wdeclaration-after-statement
1111
DEVELOPER_CFLAGS += -Wformat-security
12-
DEVELOPER_CFLAGS += -Wno-format-zero-length
1312
DEVELOPER_CFLAGS += -Wold-style-definition
1413
DEVELOPER_CFLAGS += -Woverflow
1514
DEVELOPER_CFLAGS += -Wpointer-arith

0 commit comments

Comments
 (0)