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:
committed by
Aleksander Morgado
parent
7f78ef5010
commit
9dac5ece77
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user