summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-09-07 11:03:30 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-09-07 11:03:30 +0200
commit3e78b6e2d5fea8b1e1672ce0439757d2a7fa004d (patch)
tree6806cf10808177a85f4a6db97d7fc6a691fc1ad1
parentd799b77372f751b4efebb11431243a37eddaef6a (diff)
downloadcurl-bagder/gcc-enum-conversion.tar.gz
configure: let --enable-debug set -Wenum-conversion with gcc >= 10bagder/gcc-enum-conversion
Unfortunately, this option is not detecting the same issues as clang's -Wassign-enum flag, but should still be useful to detect future mistakes.
-rw-r--r--m4/curl-compilers.m44
1 files changed, 4 insertions, 0 deletions
diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4
index 107dc6ab9..b0d5d4213 100644
--- a/m4/curl-compilers.m4
+++ b/m4/curl-compilers.m4
@@ -1119,6 +1119,10 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
fi
fi
fi
+ dnl Only gcc 10 or later
+ if test "$compiler_num" -ge "1000"; then
+ CURL_ADD_COMPILER_WARNINGS([tmp_CFLAGS], [enum-conversion])
+ fi
;;
#
HP_UX_C)