On Thu, Nov 15, 2018 at 09:30:42AM +0800, Qu Wenruo wrote: > BTW, could we just make "-Wunused-but-set-variable" default for btrfs > module instead of following the global setting? We'd need to fix all the warnings first, there are more left. We could make it on by default for the debugging build though. I've checked that the the macro from scripts/Makefile.extrawarn to detect the options is available when building the module so, something like ifeq(CONFIG_BTRFS_DEBUG,y) warnings+=$(call cc-option,-Wunused-but-set-variable) ... ccflags-y+=$(warnings) endif may be a good start.
