Skip to content

Commit e9aa7c2

Browse files
lorddoskiaskdave
authored andcommitted
btrfs: enable W=1 checks for btrfs
Now that the btrfs' codebase is clean of almost all W=1 warnings let's enable those checks unconditionally for the entire fs/btrfs/ and its subdirectories to catch potential errors during development. Signed-off-by: Nikolay Borisov <[email protected]> Reviewed-by: David Sterba <[email protected]> [ add some comments ] Signed-off-by: David Sterba <[email protected]>
1 parent 71c3678 commit e9aa7c2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

fs/btrfs/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3+
# Subset of W=1 warnings
4+
subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
5+
subdir-ccflags-y += -Wmissing-declarations
6+
subdir-ccflags-y += -Wmissing-format-attribute
7+
subdir-ccflags-y += -Wmissing-prototypes
8+
subdir-ccflags-y += -Wold-style-definition
9+
subdir-ccflags-y += -Wmissing-include-dirs
10+
subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
11+
subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
12+
subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
13+
subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
14+
# The following turn off the warnings enabled by -Wextra
15+
subdir-ccflags-y += -Wno-missing-field-initializers
16+
subdir-ccflags-y += -Wno-sign-compare
17+
subdir-ccflags-y += -Wno-type-limits
18+
319
obj-$(CONFIG_BTRFS_FS) := btrfs.o
420

521
btrfs-y += super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \

0 commit comments

Comments
 (0)