]> granicus.if.org Git - curl/commitdiff
curl-compilers.m4: enable missing-variable-declarations clang warning
authorMarcel Raad <raad@teamviewer.com>
Fri, 16 Jun 2017 12:08:28 +0000 (14:08 +0200)
committerMarcel Raad <raad@teamviewer.com>
Fri, 16 Jun 2017 20:32:05 +0000 (22:32 +0200)
It usually warns when forgetting to declare TU-local variables static.

Closes https://github.com/curl/curl/pull/1578

m4/curl-compilers.m4

index 7d53953c91d48f327775378adbb93fa84ebd0855..9efe2ae2350202a63ecc76a6b13db299e62903b8 100644 (file)
@@ -892,6 +892,11 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
             tmp_CFLAGS="$tmp_CFLAGS -Wshift-sign-overflow"
           fi
           #
+          dnl Only clang 3.2 or later
+          if test "$compiler_num" -ge "302"; then
+            tmp_CFLAGS="$tmp_CFLAGS -Wmissing-variable-declarations"
+          fi
+          #
           dnl Only clang 3.6 or later
           if test "$compiler_num" -ge "306"; then
             tmp_CFLAGS="$tmp_CFLAGS -Wdouble-promotion"