]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
configure: let --enable-debug set -Wenum-conversion with gcc >= 10
authorDaniel Stenberg <daniel@haxx.se>
Mon, 7 Sep 2020 09:03:30 +0000 (11:03 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 7 Sep 2020 20:47:39 +0000 (22:47 +0200)
Unfortunately, this option is not detecting the same issues as clang's
-Wassign-enum flag, but should still be useful to detect future
mistakes.

Closes #5930

m4/curl-compilers.m4

index 107dc6ab91698abd49ec2c019a84fd2c1ef5b4a5..b0d5d42137aa18203b3f878c7ba840b636663eff 100644 (file)
@@ -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)