diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp b/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp index ccf91720de4..f5c8e93b4f7 100644 --- a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +++ b/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp @@ -4,6 +4,8 @@ #include "Shareables.h" #include "WorkletRuntime.h" +#include + #ifdef ANDROID #include "Logger.h" #else @@ -110,13 +112,11 @@ void WorkletRuntimeDecorator::decorate( auto argsArray = shareableArgs->toJSValue(rt).asObject(rt).asArray(rt); auto argsSize = argsArray.size(rt); - // number of arguments is typically relatively small so it is ok to - // to use VLAs here, hence disabling the lint rule - jsi::Value args[argsSize]; // NOLINT(runtime/arrays) + std::vector args(argsSize); for (size_t i = 0; i < argsSize; i++) { args[i] = argsArray.getValueAtIndex(rt, i); } - remoteFun.asObject(rt).asFunction(rt).call(rt, args, argsSize); + remoteFun.asObject(rt).asFunction(rt).call(rt, const_cast(args.data()), args.size()); } }); }); diff --git a/packages/react-native-reanimated/android/CMakeLists.txt b/packages/react-native-reanimated/android/CMakeLists.txt index 83c52a36450..e6fae24cbb6 100644 --- a/packages/react-native-reanimated/android/CMakeLists.txt +++ b/packages/react-native-reanimated/android/CMakeLists.txt @@ -15,7 +15,7 @@ add_compile_options(${folly_FLAGS}) string(APPEND CMAKE_CXX_FLAGS " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION} -DREANIMATED_VERSION=${REANIMATED_VERSION} -DHERMES_ENABLE_DEBUGGER=${HERMES_ENABLE_DEBUGGER}") -string(APPEND CMAKE_CXX_FLAGS " -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++${CMAKE_CXX_STANDARD} -Wall -Werror") +string(APPEND CMAKE_CXX_FLAGS " -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++${CMAKE_CXX_STANDARD} -Wall -Wpedantic -Werror") if(${IS_NEW_ARCHITECTURE_ENABLED}) string(APPEND CMAKE_CXX_FLAGS " -DRCT_NEW_ARCH_ENABLED")