configure: correctly discover -W options for clang

clang doesn't error out on unknown -W options unless
-Werror=unknown-warning-option is specified first, so do that so the
configure script can do its job.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2016-05-16 21:35:48 -07:00
parent acbf8f0e19
commit c9fd7b2aa5

View File

@ -183,6 +183,10 @@ AC_ARG_ENABLE([ccache],
[])
PA_ADD_CFLAGS([-pedantic])
dnl LLVM doesn't error out on invalid -W options unless this option is
dnl specified first. Enable this so this script can actually discover
dnl which -W options are possible for this compiler.
PA_ADD_CFLAGS([-Werror=unknown-warning-option])
dnl Suppress format warning on Windows targets due to their <inttypes.h>
PA_ADD_CFLAGS([-Wpedantic-ms-format],[-Wno-pedantic-ms-format])
PA_ADD_CFLAGS([-Wc90-c99-compat])