aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2019-04-03 10:44:57 -0700
committerAleksander Morgado <aleksander@gnu.org>2019-04-05 08:02:14 +0000
commit9dac5ece77ef75ace284a0b3145f06feb099d0f9 (patch)
treed6c6f05b17ae3bc9819d013ae9f1da2bb55dd997
parent7f78ef50100f7f125ddcd47a721676d80e86d1fe (diff)
build: make compiler warning options compatible with clang
This patch updates m4/compiler-warnings.m4 as follows to make it more compatible with clang: * clang doesn't support -Wunused-but-set-variable, which can be replaced with -Wunused-variable as the latter covers unused variables with or without an assigned value and is supported by gcc and clang. * -Wno-unused-function is added to let clang ignore unused functions that are auto-generated.
-rw-r--r--m4/compiler_warnings.m44
1 files changed, 2 insertions, 2 deletions
diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4
index 2a682684..35d005c2 100644
--- a/m4/compiler_warnings.m4
+++ b/m4/compiler_warnings.m4
@@ -10,8 +10,8 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
for option in -Wmissing-declarations -Wmissing-prototypes \
-Wdeclaration-after-statement -Wstrict-prototypes \
-Wno-unused-parameter -Wno-sign-compare \
- -Wno-deprecated-declarations \
- -Wunused-but-set-variable -Wformat-security; do
+ -Wno-deprecated-declarations -Wno-unused-function \
+ -Wunused-variable -Wformat-security; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option -Werror"
AC_MSG_CHECKING([whether gcc understands $option])