]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
compiler: -Wnested-externs hardening 2824/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 5 Feb 2019 22:50:43 +0000 (23:50 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 5 Feb 2019 23:04:04 +0000 (00:04 +0100)
Warn if an extern declaration is encountered within a function.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
configure.ac
src/tests/lxc-test-utils.c

index 664ce9b1cb682c077b22c1ac1ba8a309f8cb5da9..8313b18d18d4e0a2baf7d21b86a3f0345ab2ac4d 100644 (file)
@@ -718,6 +718,7 @@ AX_CHECK_COMPILE_FLAG([-fdiagnostics-show-option], [CFLAGS="$CFLAGS -fdiagnostic
 AX_CHECK_COMPILE_FLAG([-Werror=shift-count-overflow], [CFLAGS="$CFLAGS -Werror=shift-count-overflow"],,[-Werror])
 AX_CHECK_COMPILE_FLAG([-Werror=shift-overflow=2], [CFLAGS="$CFLAGS -Werror=shift-overflow=2"],,[-Werror])
 AX_CHECK_COMPILE_FLAG([-Wdate-time], [CFLAGS="$CFLAGS -Wdate-time"],,[-Werror])
+AX_CHECK_COMPILE_FLAG([-Wnested-externs], [CFLAGS="$CFLAGS -Wnested-externs"],,[-Werror])
 
 AX_CHECK_LINK_FLAG([-z relro], [LDLAGS="$LDLAGS -z relro"],,[])
 AX_CHECK_LINK_FLAG([-z now], [LDLAGS="$LDLAGS -z now"],,[])
index d0c07dc59dd65f905d4de94d5776bda8695998cb..4f7950ce8446b02577f7c94cc735cb675a667f3c 100644 (file)
@@ -38,6 +38,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include "confile_utils.h"
 #include "lxctest.h"
 #include "macro.h"
 #include "utils.h"
@@ -519,8 +520,6 @@ void test_parse_byte_size_string(void)
 
 void test_lxc_config_net_hwaddr(void)
 {
-       bool lxc_config_net_hwaddr(const char *line);
-
        if (!lxc_config_net_hwaddr("lxc.net.0.hwaddr = 00:16:3e:04:65:b8\n"))
                exit(EXIT_FAILURE);