summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-03-24 13:22:46 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-03-25 13:46:09 +0100
commit518e7f902072858939c4fd0150c419a94adc7a87 (patch)
tree3e9c7f6942784d787cbe0a68fcac5dacf8445610 /Makefile
parent45384434d8e597fce628d240ad810813474c50a0 (diff)
downloadbarebox-518e7f902072858939c4fd0150c419a94adc7a87.tar.gz
barebox-518e7f902072858939c4fd0150c419a94adc7a87.tar.xz
kbuild: add -Wtype-limits to compile flags
Not warning about e.g. comparisons of unsigned integers with 0 can introduce nasty bugs around error handling especially. Enable the warning to be able to identify these issues in future. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index de581180d3..e8f1f8dc2d 100644
--- a/Makefile
+++ b/Makefile
@@ -650,6 +650,9 @@ CHECKFLAGS += $(NOSTDINC_FLAGS)
# warn about C99 declaration after statement
KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
+# warn about e.g. (unsigned)x < 0
+KBUILD_CFLAGS += $(call cc-option,-Wtype-limits)
+
# disable pointer signed / unsigned warnings in gcc 4.0
KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)