From a9c86c0670f7ed763dedc9cc59dd288d5cc1011b Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 22 Apr 2025 11:59:48 -0600 Subject: Explicitly ban VLA --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fa048f..a221c77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,10 @@ if ((PICO_PLATFORM STREQUAL "host") AND (NOT PICO_NO_GC_SECTIONS)) add_link_options("LINKER:--gc-sections") endif() +# Disable language misfeatures. +add_compile_options(-Werror=vla) + +# Have the compiler help detect mistakes. add_compile_options(-Wall -Wextra -Wswitch-enum -Werror) string(TOUPPER "${CMAKE_BUILD_TYPE}" _upper_cmake_build_type) -- cgit v1.2.3-2-g168b