Skip to content

Commit 36da893

Browse files
peffgitster
authored andcommitted
config.mak.dev: enable -Wunused-function
We explicitly omitted -Wunused-function when we added -Wextra, but there is no need: the current code compiles cleanly with it. And it's worth having, since it can let you know when there are cascading effects from a cleanup (e.g., deleting one function lets you delete its static helpers). There are cases where we may need an unused function to exist, but we can handle these easily: - macro-generated code like commit-slab; there we have the MAYBE_UNUSED annotation to silence the compiler - conditional compilation, where we may or may not need a static helper. These generally fall into one of two categories: - the call should not be conditional, but rather the function body itself should be (and may just be a no-op on one side of the #if). That keeps the conditional pollution out of the main code. - call-chains of static helpers should all be in the same #if block, so they are all-or-nothing And if there's some case that doesn't cover, we still have MAYBE_UNUSED as a fallback. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cae598d commit 36da893

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
@@ -33,7 +33,6 @@ ifeq ($(filter extra-all,$(DEVOPTS)),)
3333
CFLAGS += -Wno-empty-body
3434
CFLAGS += -Wno-missing-field-initializers
3535
CFLAGS += -Wno-sign-compare
36-
CFLAGS += -Wno-unused-function
3736
CFLAGS += -Wno-unused-parameter
3837
endif
3938
endif

0 commit comments

Comments
 (0)