From 17950e5a43179176381b2efb6faa0d433fe2f825 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Wed, 25 Aug 2021 12:58:27 +0200 Subject: [PATCH] Fix API incompatibility detection in configure script Convert warning about int to pointer detection into an error. Signed-off-by: Robert Baldyga --- configure.d/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.d/Makefile b/configure.d/Makefile index 422e107..46c64f1 100644 --- a/configure.d/Makefile +++ b/configure.d/Makefile @@ -8,6 +8,14 @@ obj-m += test_mod.o MAKE_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) +check_cflag=$(shell echo "" | \ + gcc -c -xc ${1} -o /dev/null - 2>/dev/null; \ + if [ $$? -eq 0 ]; then echo 1; else echo 0; fi; ) + +ifeq ($(call check_cflag,-Werror=int-conversion), 1) +EXTRA_CFLAGS += -Werror=int-conversion +endif + all: make -C $(KERNEL_DIR) M=$(MAKE_DIR) modules clean: