Skip to content

Commit a219a67

Browse files
peffgitster
authored andcommitted
config.mak.dev: enable -Wunused-parameter by default
Having now removed or annotated all of the unused function parameters in our code base, I found that each instance falls into one of three categories: 1. ignoring the parameter is a bug (e.g., a function takes a ptr/len pair, but ignores the length). Detecting these helps us find the bugs. 2. the parameter is unnecessary (and usually left over from a refactoring or earlier iteration of a patches series). Removing these cleans up the code. 3. the function has to conform to a specific interface (because it's used via a function pointer, or matches something on the other side of an #ifdef). These ones are annoying, but annotating them with UNUSED is not too bad (especially if the compiler tells you about the problem promptly). Certainly instances of (3) are more common than (1), but after finding all of these, I think there were enough cases of (1) that it justifies the work in annotating all of the (3)s. And since the code base is now at a spot where we compile cleanly with -Wunused-parameter, turning it on will make it the responsibility of individual patch writers going forward. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b652382 commit a219a67

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
@@ -54,7 +54,6 @@ ifeq ($(filter extra-all,$(DEVOPTS)),)
5454
DEVELOPER_CFLAGS += -Wno-empty-body
5555
DEVELOPER_CFLAGS += -Wno-missing-field-initializers
5656
DEVELOPER_CFLAGS += -Wno-sign-compare
57-
DEVELOPER_CFLAGS += -Wno-unused-parameter
5857
endif
5958
endif
6059

0 commit comments

Comments
 (0)