From 314a7fa3ceb74f90cc7cce28bef7517ef874f64c Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Tue, 30 May 2017 10:07:47 +0200 Subject: 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 --- m4/curl-compilers.m4 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'm4/curl-compilers.m4') diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 589032446..673f64097 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 ;; # -- cgit v1.2.1