Meta: Enable warning for the use of VLAs

This commit enables warnings when using variable length arrays. For
disabling this warning locally use -Wno-vla, as it will work both across
Clang and GCC.
This commit is contained in:
R-Goc 2024-12-16 23:50:15 +01:00 committed by Jelle Raaijmakers
parent 74309ce8c2
commit 9cb397914e
Notes: github-actions[bot] 2024-12-20 08:38:50 +00:00

View file

@ -96,12 +96,12 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES
add_cxx_compile_options(-Wno-implicit-const-int-float-conversion)
add_cxx_compile_options(-Wno-user-defined-literals)
add_cxx_compile_options(-Wno-vla-cxx-extension)
add_cxx_compile_options(-Wno-unqualified-std-cast-call)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Only ignore expansion-to-defined for g++, clang's implementation doesn't complain about function-like macros
add_cxx_compile_options(-Wno-expansion-to-defined)
add_cxx_compile_options(-Wno-literal-suffix)
add_cxx_compile_options(-Wvla)
# FIXME: This warning seems useful but has too many false positives with GCC 13.
add_cxx_compile_options(-Wno-dangling-reference)