diff options
Diffstat (limited to 'm4/curl-compilers.m4')
| -rw-r--r-- | m4/curl-compilers.m4 | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 422946e2..c1ae6a55 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. +# Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -1044,6 +1044,23 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ tmp_CFLAGS="$tmp_CFLAGS -Wdouble-promotion" fi # + dnl Only gcc 6 or later + if test "$compiler_num" -ge "600"; then + tmp_CFLAGS="$tmp_CFLAGS -Wshift-negative-value" + tmp_CFLAGS="$tmp_CFLAGS -Wshift-overflow=2" + tmp_CFLAGS="$tmp_CFLAGS -Wnull-dereference" + tmp_CFLAGS="$tmp_CFLAGS -Wduplicated-cond" + fi + # + dnl Only gcc 7 or later + if test "$compiler_num" -ge "700"; then + tmp_CFLAGS="$tmp_CFLAGS -Wduplicated-branches" + tmp_CFLAGS="$tmp_CFLAGS -Wrestrict" + tmp_CFLAGS="$tmp_CFLAGS -Walloc-zero" + tmp_CFLAGS="$tmp_CFLAGS -Wformat-overflow=2" + tmp_CFLAGS="$tmp_CFLAGS -Wformat-truncation=2" + fi + # fi # dnl Do not issue warnings for code in system include paths. @@ -1282,15 +1299,6 @@ AC_DEFUN([CURL_CHECK_CURLDEBUG], [ want_curldebug="no" fi fi - # - if test "$want_curldebug" = "yes"; then - CPPFLAGS="-DCURLDEBUG $CPPFLAGS" - squeeze CPPFLAGS - fi - if test "$want_debug" = "yes"; then - CPPFLAGS="-DDEBUGBUILD $CPPFLAGS" - squeeze CPPFLAGS - fi ]) |
