On Fri, Nov 16, 2018 at 03:54:18PM +0800, Qu Wenruo wrote:
> We imported cc-option but forgot to import cc-disable-warning.
> 
> Fixes: b556a992c3ad ("btrfs-progs: build: allow to build with various 
> compiler warnings")
> Signed-off-by: Qu Wenruo <w...@suse.com>
> ---
>  Makefile.extrawarn | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Makefile.extrawarn b/Makefile.extrawarn
> index 1f4bda94a167..5849036fd166 100644
> --- a/Makefile.extrawarn
> +++ b/Makefile.extrawarn
> @@ -19,6 +19,12 @@ try-run = $(shell set -e;               \
>   cc-option = $(call try-run,\
>           $(CC) $(CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
>  
> +# cc-disable-warning
> +# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
> +cc-disable-warning = $(call try-run,\
> +     $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c 
> -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))

btrfs-progs don't use KBUILD_CPPFLAGS nor CC_OPTION_CFLAGS so this needs
to be properly ported from kernel.

Reply via email to