From ff25168a531bf9e0dd0d3ba96ad9c2966c64e944 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 4 Jan 2023 16:11:21 +0100 Subject: Always enable -Wvla It's only the -Werror part we want to be conditional on being debug builds. --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 70ccdbba..486c64ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,12 +73,12 @@ ENDIF() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") # Tell the compiler to be stringent -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat=2") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wformat=2") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat=2 -Wvla") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wformat=2 -Wvla") # Make sure we catch these issues whilst developing IF(CMAKE_BUILD_TYPE MATCHES Debug) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Werror=vla") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Werror=vla") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") ENDIF() # clang doesn't support format_arg, which breaks this warning if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") -- cgit v1.2.3