From: Marcel Raad Date: Tue, 30 May 2017 08:07:47 +0000 (+0200) Subject: curl-compilers.m4: enable -Wshift-sign-overflow for clang X-Git-Tag: curl-7_54_1~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=314a7fa3ceb74f90cc7cce28bef7517ef874f64c;p=thirdparty%2Fcurl.git 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 --- diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 5890324468..673f640979 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -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 ;; #