From 1bee8b3d288bc2c26432b8e675b18e482a98255e Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 28 May 2018 11:51:35 +0200 Subject: build: Check for variable length arrays The clang and gcc compilers don't complain about variable length arrays using the -c89 flag unless the flag -Wvla or -Wpedantic is set. This also fixes a memleak and two false positive uninitialized variable warnings reported by the clang static analyzer in graph.c. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d6d59229..535eef6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,6 +79,7 @@ test_and_set_c_compiler_flag_global(-Werror) test_and_set_c_compiler_flag_global(-Wundef) test_and_set_c_compiler_flag_global(-Wpointer-arith) test_and_set_c_compiler_flag_global(-Wstrict-prototypes) +test_and_set_c_compiler_flag_global(-Wvla) #Wswitch-default check fails on the swig-generated code #test_and_set_c_compiler_flag_global(-Wswitch-default) test_and_set_c_compiler_flag_global(-Wunreachable-code) -- cgit v1.2.3