[configure.ac] Only disable -Wno-zero-length-array on clang
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 24 Oct 2016 13:17:54 +0000 (15:17 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 24 Oct 2016 13:17:54 +0000 (15:17 +0200)
The $GCC variable in autoconf will be yes for clang as well [1].

[1] https://lists.gnu.org/archive/html/autoconf/2014-09/msg00023.html

configure.ac

index aed6989394d68d9d335703a8cb403d908dcf88c3..cc55c8b33c6d0039c4c080d8dc88ac1b6dfd7518 100644 (file)
@@ -550,9 +550,6 @@ if test x"$GCC" = xyes; then
                # We rely on signed overflow to behave
                CFLAGS="$CFLAGS -fwrapv"
 
-               # We rely on zero length arrays in structs
-               CFLAGS="$CFLAGS -Wno-zero-length-array"
-
                CFLAGS="$CFLAGS -DMONO_DLL_EXPORT"
                if test x"$disable_visibility_hidden" = xno; then
                   # Don't export any symbols by default
@@ -579,6 +576,8 @@ if test x"$GCC" = xyes; then
                   # https://bugzilla.samba.org/show_bug.cgi?id=8118
                   WARN="$WARN -Qunused-arguments"
                   WARN="$WARN -Wno-unused-function -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address -Wno-constant-logical-operand"
+                  # We rely on zero length arrays in structs
+                  WARN="$WARN -Wno-zero-length-array"
                fi
 else
        # The Sun Forte compiler complains about inline functions that access static variables