[PATCH] build: enable -Wtype-limits

Ben Chan benchan at chromium.org
Mon Dec 10 18:56:05 UTC 2018


-Wtype-limits helps catch unnecessary comparisons such as comparing
unsigned variables <= 0.

This patch essentially brings the list of compiler warnings defined in
m4/compiler-warnings.m4 to be on par with libqmi.
---
 m4/compiler-warnings.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/compiler-warnings.m4 b/m4/compiler-warnings.m4
index eb78503..77b79c5 100644
--- a/m4/compiler-warnings.m4
+++ b/m4/compiler-warnings.m4
@@ -15,7 +15,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
 		      -Wundef -Wimplicit-function-declaration \
 		      -Wpointer-arith -Winit-self -Wshadow \
 		      -Wmissing-include-dirs -Waggregate-return \
-		      -Wformat-security; do
+		      -Wformat-security -Wtype-limits; do
 		SAVE_CFLAGS="$CFLAGS"
 		CFLAGS="$CFLAGS $option"
 		AC_MSG_CHECKING([whether gcc understands $option])
-- 
2.20.0.rc2.403.gdbc3b29805-goog



More information about the libmbim-devel mailing list