diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-22 11:59:48 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-06 11:50:46 -0600 |
commit | a9c86c0670f7ed763dedc9cc59dd288d5cc1011b (patch) | |
tree | c2816d6050f71906c94dafa4c23c7743089008ed | |
parent | 797a77fcc8655a641630758dc4022f215008f23b (diff) |
Explicitly ban VLA
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
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) |