configure: Error on unused command line argument to catch unknown options with clang.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Alexandre Julliard 2019-07-03 11:00:17 +02:00
parent 5d7d940114
commit 3b5f48abc5
2 changed files with 30 additions and 4 deletions

29
configure vendored
View File

@ -16736,6 +16736,31 @@ fi
$as_echo "$ac_cv_cflags__Werror_unknown_warning_option" >&6; }
if test "x$ac_cv_cflags__Werror_unknown_warning_option" = xyes; then :
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unused-command-line-argument" >&5
$as_echo_n "checking whether the compiler supports -Werror=unused-command-line-argument... " >&6; }
if ${ac_cv_cflags__Werror_unused_command_line_argument+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_wine_try_cflags_saved=$CFLAGS
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(int argc, char **argv) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_cflags__Werror_unused_command_line_argument=yes
else
ac_cv_cflags__Werror_unused_command_line_argument=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_wine_try_cflags_saved
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Werror_unused_command_line_argument" >&5
$as_echo "$ac_cv_cflags__Werror_unused_command_line_argument" >&6; }
if test "x$ac_cv_cflags__Werror_unused_command_line_argument" = xyes; then :
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wdeclaration-after-statement" >&5
$as_echo_n "checking whether the compiler supports -Wdeclaration-after-statement... " >&6; }
@ -17122,8 +17147,6 @@ $as_echo "$ac_cv_c_logicalop_noisy" >&6; }
test "$ac_cv_c_logicalop_noisy" = yes || EXTRACFLAGS="$EXTRACFLAGS -Wlogical-op"
fi
CFLAGS=$saved_CFLAGS
for ac_flag in $CFLAGS; do
case $ac_flag in
-g) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -gdwarf-2" >&5
@ -17316,6 +17339,8 @@ fi ;;
esac ;;
esac
CFLAGS=$saved_CFLAGS
if test "x$enable_maintainer_mode" = "xyes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror" >&5

View File

@ -1975,6 +1975,7 @@ then
dnl clang needs to be told to fail on unknown options
saved_CFLAGS=$CFLAGS
WINE_TRY_CFLAGS([-Werror=unknown-warning-option],[CFLAGS="$CFLAGS -Werror=unknown-warning-option"])
WINE_TRY_CFLAGS([-Werror=unused-command-line-argument],[CFLAGS="$CFLAGS -Werror=unused-command-line-argument"])
WINE_TRY_CFLAGS([-Wdeclaration-after-statement])
WINE_TRY_CFLAGS([-Wempty-body])
WINE_TRY_CFLAGS([-Wignored-qualifiers])
@ -2006,8 +2007,6 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
CFLAGS=$saved_string_h_CFLAGS
test "$ac_cv_c_logicalop_noisy" = yes || EXTRACFLAGS="$EXTRACFLAGS -Wlogical-op"])
CFLAGS=$saved_CFLAGS
dnl Default to dwarf-2 debug info
for ac_flag in $CFLAGS; do
case $ac_flag in
@ -2036,6 +2035,8 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
esac ;;
esac
CFLAGS=$saved_CFLAGS
dnl Enable -Werror for maintainer mode
if test "x$enable_maintainer_mode" = "xyes"
then