]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Adds C++ warning flag for C Variable-Length Arrays. 15342/head
authorJesse Williamson <jwilliamson@suse.de>
Sun, 28 May 2017 12:24:26 +0000 (05:24 -0700)
committerJesse Williamson <jwilliamson@suse.de>
Sun, 28 May 2017 12:24:26 +0000 (05:24 -0700)
C VLAs are not supported in C++. However, the GNU compiler allows
them as an extension, which it does not warn about when not in
pedantic mode. Unfortunately, it's easy to accidentally write
a VLA, even unintentionally-- adding this warning will help us
catch that.

Signed-off-by: Jesse Williamson <jwilliamson@suse.de>
src/CMakeLists.txt

index 4506d2fdfd89d3b799b5fc7741e4cc90c7e97e74..823627e966212f4a64140c25e8da7c9c29bb69e6 100644 (file)
@@ -34,6 +34,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Werror=format-security -fno
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-1024 -Wno-invalid-offsetof")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wvla")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas")
 if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)