diff --git a/CMakeLists.txt b/CMakeLists.txt index a313673fe0..fd65ffde4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -688,7 +688,7 @@ if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-noexcept-type") # Added for gtest endif() endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Werror=vla") if(USE_SANITIZE_UB) check_cxx_compiler_flag(-fsanitize=undefined COMPILER_SUPPORTS_UNDEFINED_BEHAVIOR_SANITIZER) diff --git a/level_zero/tools/test/black_box_tests/zello_sysman.cpp b/level_zero/tools/test/black_box_tests/zello_sysman.cpp index 41584181d2..11504ffaa8 100644 --- a/level_zero/tools/test/black_box_tests/zello_sysman.cpp +++ b/level_zero/tools/test/black_box_tests/zello_sysman.cpp @@ -825,9 +825,9 @@ void testSysmanFirmware(ze_device_handle_t &device, std::string imagePath) { std::cout << "firmware version = " << fwProperties.version << std::endl; } if (imagePath.size() != 0 && imgSize > 0) { - char img[imgSize]; - imageFile.read(img, imgSize); - VALIDATECALL(zesFirmwareFlash(handle, img, static_cast(imgSize))); + std::vector img(imgSize); + imageFile.read(img.data(), imgSize); + VALIDATECALL(zesFirmwareFlash(handle, img.data(), static_cast(imgSize))); VALIDATECALL(zesFirmwareGetProperties(handle, &fwProperties)); if (verbose) {