Fix warnings when compiled with clang

When clang sees an unknown warning option, unlike gcc it doesn't fail the build
with error. It issues a warning. Hence JE_CFLAGS_ADD with warning options that
didnt't exist in clang would still mark those options as available. This led to
several warnings when built with clang or "gcc" on OSX. This change fixes those
warnings by simply making clang fail builds with non-existent warning options.
This commit is contained in:
Alex Lapenkou 2021-08-12 19:02:12 -07:00 committed by Alexander Lapenkov
parent 9d02bdc883
commit 2c625d5cd9

View File

@ -244,6 +244,7 @@ if test "x$GCC" = "xyes" ; then
AC_DEFINE_UNQUOTED([JEMALLOC_HAS_RESTRICT])
fi
fi
JE_CFLAGS_ADD([-Werror=unknown-warning-option])
JE_CFLAGS_ADD([-Wall])
JE_CFLAGS_ADD([-Wextra])
JE_CFLAGS_ADD([-Wshorten-64-to-32])