[lxc-devel] [lxc/master] lxc: fix build with --disable-werror

ffontaine on Github lxc-bot at linuxcontainers.org
Sat Sep 8 19:13:12 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 563 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180908/af21e6ae/attachment.bin>
-------------- next part --------------
From 218e814412afe2857c118fc08759a943349f3ca0 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
Date: Sat, 8 Sep 2018 21:05:58 +0200
Subject: [PATCH] lxc: fix build with --disable-werror

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 at gmail.com>
---
 configure.ac | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 54964fb40..502b9ae1d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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],


More information about the lxc-devel mailing list