diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-10-15 00:59:11 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-10-15 10:12:58 +0200 |
commit | 834bd7f54486634748c5995bd43b9e3b3997f8c6 (patch) | |
tree | 1287fc9214b8e3fcca04e9546824abc4edd0cef0 | |
parent | 15997f6db53c70070177739716dc518e667e6090 (diff) | |
download | curl-834bd7f54486634748c5995bd43b9e3b3997f8c6.tar.gz |
configure: do not set -Wformat=2 for mingw debug builds
With GCC 10 (at least) on mingw, we get false positive warnings
when using this option. Never use it for mingw.
Fixes #6079
-rw-r--r-- | m4/curl-compilers.m4 | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4 index 7d59f0667..4745dee20 100644 --- a/m4/curl-compilers.m4 +++ b/m4/curl-compilers.m4 @@ -1074,9 +1074,19 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [ fi # dnl only gcc 4.8 or later - if test "$compiler_num" -ge "408"; then - tmp_CFLAGS="$tmp_CFLAGS -Wformat=2" - fi + case $host_os in + mingw*) + dnl for mingw, switch it off! + if test "$compiler_num" -ge "408"; then + tmp_CFLAGS="$tmp_CFLAGS -Wno-format" + fi + ;; + *) + if test "$compiler_num" -ge "408"; then + tmp_CFLAGS="$tmp_CFLAGS -Wformat=2" + fi + ;; + esac # dnl Only gcc 5 or later if test "$compiler_num" -ge "500"; then |