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.
This commit is contained in:
Ben Chan
2019-04-05 08:02:14 +00:00
committed by Aleksander Morgado
parent 7f78ef5010
commit 9dac5ece77
+2 -2
View File
@@ -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])