mirror of
https://github.com/curl/curl.git
synced 2024-12-03 06:20:31 +08:00
autotools: sync up clang picky warnings with cmake
Bringing missing options over from CMake. Move around existing `-Wno-pointer-bool-conversion` option to come _after_ `-Wconversion`. Reviewed-by: Marcel Raad Closes #10974
This commit is contained in:
parent
17c71df421
commit
81c9c8cd39
@ -507,9 +507,6 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [
|
|||||||
dnl warn about compile-time arguments used during link-time, like
|
dnl warn about compile-time arguments used during link-time, like
|
||||||
dnl -O and -g and -pedantic.
|
dnl -O and -g and -pedantic.
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments"
|
tmp_CFLAGS="$tmp_CFLAGS -Qunused-arguments"
|
||||||
dnl Disable pointer to bool conversion warnings since they cause
|
|
||||||
dnl lib/securetransp.c cause several warnings for checks we want.
|
|
||||||
tmp_CFLAGS="$tmp_CFLAGS -Wno-pointer-bool-conversion"
|
|
||||||
;;
|
;;
|
||||||
#
|
#
|
||||||
DEC_C)
|
DEC_C)
|
||||||
@ -814,8 +811,19 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
|
|||||||
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [shift-sign-overflow])
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [shift-sign-overflow])
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
dnl Only clang 3.0 or later (possibly earlier)
|
||||||
|
if test "$compiler_num" -ge "300"; then
|
||||||
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [bad-function-cast])
|
||||||
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [conversion])
|
||||||
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [empty-body])
|
||||||
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [ignored-qualifiers])
|
||||||
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [type-limits])
|
||||||
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [no-sign-conversion])
|
||||||
|
fi
|
||||||
|
#
|
||||||
dnl Only clang 3.2 or later
|
dnl Only clang 3.2 or later
|
||||||
if test "$compiler_num" -ge "302"; then
|
if test "$compiler_num" -ge "302"; then
|
||||||
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [enum-conversion])
|
||||||
case $host_os in
|
case $host_os in
|
||||||
cygwin* | mingw*)
|
cygwin* | mingw*)
|
||||||
dnl skip missing-variable-declarations warnings for cygwin and
|
dnl skip missing-variable-declarations warnings for cygwin and
|
||||||
@ -827,6 +835,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
|
dnl Only clang 3.4 or later
|
||||||
|
if test "$compiler_num" -ge "304"; then
|
||||||
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [unused-const-variable])
|
||||||
|
fi
|
||||||
|
#
|
||||||
dnl Only clang 3.6 or later
|
dnl Only clang 3.6 or later
|
||||||
if test "$compiler_num" -ge "306"; then
|
if test "$compiler_num" -ge "306"; then
|
||||||
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [double-promotion])
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [double-promotion])
|
||||||
@ -847,6 +860,10 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
|
|||||||
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [extra-semi-stmt])
|
CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [extra-semi-stmt])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
dnl Disable pointer to bool conversion warnings since they cause
|
||||||
|
dnl lib/securetransp.c cause several warnings for checks we want.
|
||||||
|
dnl This option should be placed after -Wconversion.
|
||||||
|
tmp_CFLAGS="$tmp_CFLAGS -Wno-pointer-bool-conversion"
|
||||||
;;
|
;;
|
||||||
#
|
#
|
||||||
DEC_C)
|
DEC_C)
|
||||||
|
Loading…
Reference in New Issue
Block a user