diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-11 14:08:28 +0200 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2021-07-19 12:53:25 +0200 |
commit | 9fec01883977f47734847d901b64eb500f090abc (patch) | |
tree | b51047e26514e9ce45ea7b00b4aafd71d0750754 | |
parent | d8c26804b465885737c854c01537021074ed2dae (diff) | |
download | neard-9fec01883977f47734847d901b64eb500f090abc.tar.gz |
build: enable -Wshadow and -Wformat-signedness compiler warnings
Enable code quality warnings - shadowing variables and using wrong
signed data in formats (leading to conversions).
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
-rw-r--r-- | accflags.m4 | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/accflags.m4 b/accflags.m4 index b1bb150..e4df62c 100644 --- a/accflags.m4 +++ b/accflags.m4 @@ -22,7 +22,10 @@ AC_DEFUN([NEARD_COMPILER_FLAGS], [ AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"]) AX_CHECK_COMPILE_FLAG([-Wjump-misses-init], [CFLAGS="$CFLAGS -Wjump-misses-init"]) AX_CHECK_COMPILE_FLAG([-Wpointer-arith], [CFLAGS="$CFLAGS -Wpointer-arith"]) + AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"]) + # GCC v5.0 + AX_CHECK_COMPILE_FLAG([-Wformat-signedness], [CFLAGS="$CFLAGS -Wformat-signedness"]) # GCC v6.0 AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [CFLAGS="$CFLAGS -Wnull-dereference"]) AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [CFLAGS="$CFLAGS -Wduplicated-cond"]) @@ -35,11 +38,7 @@ AC_DEFUN([NEARD_COMPILER_FLAGS], [ fi if (test "$USE_MAINTAINER_MODE" = "pedantic"); then AX_CHECK_COMPILE_FLAG([-Wstrict-overflow=3], [CFLAGS="$CFLAGS -Wstrict-overflow=3"]) - AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"]) AX_CHECK_COMPILE_FLAG([-Wcast-qual], [CFLAGS="$CFLAGS -Wcast-qual"]) AX_CHECK_COMPILE_FLAG([-Wunsafe-loop-optimizations], [CFLAGS="$CFLAGS -Wunsafe-loop-optimizations"]) - - # GCC v5.0 - AX_CHECK_COMPILE_FLAG([-Wformat-signedness], [CFLAGS="$CFLAGS -Wformat-signedness"]) fi ]) |