CMake: Disable Clang 18+ -Wvla-cxx-extension warning

This warning warns about variable-length arrays being a non-standard
extension to the C++ language. We still have a few instances of VLAs, so
let's disable the warning for now.

This does not interfere with `-Wvla`, which we use to completely forbid
this (potentially dangerous) feature in the Kernel and LibCrypto.
This commit is contained in:
Daniel Bertalan 2023-11-05 18:04:23 +01:00 committed by Andrew Kaster
parent 63a2039b51
commit cf3c8a216b
Notes: sideshowbarker 2024-07-16 22:16:50 +09:00

View file

@ -24,6 +24,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
add_compile_options(-Wno-implicit-const-int-float-conversion)
add_compile_options(-Wno-user-defined-literals)
add_compile_options(-Wno-vla-cxx-extension)
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_compile_options(-Wno-expansion-to-defined)