]> git.proxmox.com Git - mirror_lxc.git/commitdiff
lxc: fix build with --disable-werror
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sat, 8 Sep 2018 19:05:58 +0000 (21:05 +0200)
committerFabrice Fontaine <fontaine.fabrice@gmail.com>
Sat, 8 Sep 2018 19:09:20 +0000 (21:09 +0200)
Fix #2592 by defining -Wvla -std=gnu11 even if --disable-werror is set
As -std=gnu11 is always set, bump requirement on gcc from 4.6 to 4.7
(see https://gcc.gnu.org/projects/cxx-status.html#cxx11)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
configure.ac

index 54964fb408309279be18040f73d4d76071ba1f71..502b9ae1de569eb2491955b058e1ca32bbf66c0c 100644 (file)
@@ -53,7 +53,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #define CLANG_VERSION \
        (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
 
-#if GCC_VERSION < 40600 && CLANG_VERSION < 10000
+#if GCC_VERSION < 40700 && CLANG_VERSION < 10000
 #error Sorry, your compiler is too old - please upgrade it
 #endif
        ]])], [valid_compiler=yes], [valid_compiler=no])
@@ -683,8 +683,9 @@ AC_PROG_SED
 # See if we support thread-local storage.
 LXC_CHECK_TLS
 
+CFLAGS="$CFLAGS -Wvla -std=gnu11"
 if test "x$enable_werror" = "xyes"; then
-       CFLAGS="$CFLAGS -Werror -Wvla -std=gnu11"
+       CFLAGS="$CFLAGS -Werror"
 fi
 
 AC_ARG_ENABLE([thread-safety],