curl-compilers.m4: enable -Wshift-sign-overflow for clang

clang 2.9+ supports -Wshift-sign-overflow, which warns about undefined
behavior on signed left shifts when shifting by too many places.

Ref: https://github.com/curl/curl/issues/1516
Closes https://github.com/curl/curl/pull/1517
This commit is contained in:
Marcel Raad 2017-05-30 10:07:47 +02:00
parent a6ad28a75e
commit 314a7fa3ce
No known key found for this signature in database
GPG Key ID: 33C416EFAE4D6F02
1 changed files with 5 additions and 0 deletions

View File

@ -881,6 +881,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
if test "$compiler_num" -ge "101"; then
tmp_CFLAGS="$tmp_CFLAGS -Wunused"
fi
#
dnl Only clang 2.9 or later
if test "$compiler_num" -ge "209"; then
tmp_CFLAGS="$tmp_CFLAGS -Wshift-sign-overflow"
fi
fi
;;
#