diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index 7261885974964..0a9170709d85b 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -215,6 +215,10 @@ fi test -n "$GCC" && CFLAGS="-Wall -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare $CFLAGS" dnl Check if compiler supports -Wno-clobbered (only GCC) AX_CHECK_COMPILE_FLAG([-Wno-clobbered], CFLAGS="-Wno-clobbered $CFLAGS", , [-Werror]) +AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], CFLAGS="-Wduplicated-cond $CFLAGS", , [-Werror]) +AX_CHECK_COMPILE_FLAG([-Wlogical-op], CFLAGS="-Wlogical-op $CFLAGS", , [-Werror]) +AX_CHECK_COMPILE_FLAG([-Wformat-truncation], CFLAGS="-Wformat-truncation $CFLAGS", , [-Werror]) +AX_CHECK_COMPILE_FLAG([-fno-common], CFLAGS="-fno-common $CFLAGS", , [-Werror]) test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS" diff --git a/ext/sodium/config.m4 b/ext/sodium/config.m4 index 0676b66910680..05d9ebd5a13df 100644 --- a/ext/sodium/config.m4 +++ b/ext/sodium/config.m4 @@ -11,8 +11,9 @@ if test "$PHP_SODIUM" != "no"; then AC_DEFINE(HAVE_LIBSODIUMLIB, 1, [ ]) - dnl Add -Wno-type-limits as this may arise on 32bits platforms + dnl Add -Wno-type-limits and -Wno-logical-op as this may arise on 32bits platforms SODIUM_COMPILER_FLAGS="$LIBSODIUM_CFLAGS -Wno-type-limits" + AX_CHECK_COMPILE_FLAG([-Wno-logical-op], SODIUM_COMPILER_FLAGS="$SODIUM_COMPILER_FLAGS -Wno-logical-op", , [-Werror]) PHP_NEW_EXTENSION(sodium, libsodium.c sodium_pwhash.c, $ext_shared, , $SODIUM_COMPILER_FLAGS) PHP_SUBST(SODIUM_SHARED_LIBADD) fi