mirror of
https://github.com/curl/curl.git
synced 2026-08-25 01:03:31 +03:00
build: add picky compiler warning flags for gcc 6 and 7
This commit is contained in:
parent
4e884615d1
commit
a19fefb070
6 changed files with 25 additions and 5 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue