]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
configure: add -Wvla and -std=gnu11
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 11 Mar 2020 02:10:09 +0000 (03:10 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 11 Mar 2020 02:18:59 +0000 (03:18 +0100)
Both are standard in LXC for a long time now. And gcc-4.8 which is the
minimal compiler version we require (same as the Linux kernel) deals
with this.

Closes #362.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
configure.ac
src/proc_cpuview.c

index 21ae5131e9f93c50bc05cb62b13666ba31c19631..40928831e530e837eb37a7cc94928fd332844af8 100644 (file)
@@ -248,8 +248,8 @@ AX_CHECK_COMPILE_FLAG([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"],,[
 AX_CHECK_COMPILE_FLAG([-fasynchronous-unwind-tables], [CFLAGS="$CFLAGS -fasynchronous-unwind-tables"],,[-Werror])
 AX_CHECK_COMPILE_FLAG([-pipe], [CFLAGS="$CFLAGS -pipe"],,[-Werror])
 AX_CHECK_COMPILE_FLAG([-fexceptions], [CFLAGS="$CFLAGS -fexceptions"],,[-Werror])
-CFLAGS="$CFLAGS -fvisibility=hidden"
 
+CFLAGS="$CFLAGS -fvisibility=hidden -Wvla -std=gnu11"
 AX_CHECK_LINK_FLAG([-z relro], [LDFLAGS="$LDFLAGS -z relro"],,[])
 AX_CHECK_LINK_FLAG([-z now], [LDFLAGS="$LDFLAGS -z now"],,[])
 
index 4d8ead51267fead74db5bdf3a7f0553e6ff30af6..15a7b5c3d7ccb3f175e45dee5b718bd9cd4e6f07 100644 (file)
@@ -433,7 +433,7 @@ static bool read_cpu_cfs_param(const char *cg, const char *param, int64_t *value
        if (!cgroup_ops->get(cgroup_ops, "cpu", cg, file, &str))
                return false;
 
-       if (sscanf(str, first ? "%"PRId64 : "%*"PRId64" %"PRId64, value) != 1)
+       if (sscanf(str, first ? "%" PRId64 : "%*" PRId64 " %" PRId64, value) != 1)
                return false;
 
        return true;