fraunhoferhhi / vvenc

VVenC, the Fraunhofer Versatile Video Encoder
https://www.hhi.fraunhofer.de/en/departments/vca/technologies-and-solutions/h266-vvc.html
BSD 3-Clause Clear License
899 stars 158 forks source link

error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] #378

Closed kien091 closed 1 month ago

kien091 commented 1 month ago

I have error like this: C:\Users\ASUS\AppData\Local\Android\Sdk\ndk\27.0.11718014\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=i686-none-linux-android23 --sysroot=C:/Users/ASUS/AppData/Local/Android/Sdk/ndk/27.0.11718014/toolchains/llvm/prebuilt/windows-x86_64/sysroot -Dreanimated_EXPORTS -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/../Common/cpp/AnimatedSensor" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/../Common/cpp/Fabric" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/../Common/cpp/hidden_headers" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/../Common/cpp/LayoutAnimations" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/../Common/cpp/NativeModules" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/../Common/cpp/ReanimatedRuntime" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/../Common/cpp/Registries" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/../Common/cpp/SharedItems" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/../Common/cpp/Tools" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/android/src/main/cpp" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native/ReactAndroid/src/main/jni/react/turbomodule" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native/ReactCommon" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native/ReactCommon/callinvoker" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native/ReactCommon/react/renderer/graphics/platform/cxx" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native/ReactCommon/runtimeexecutor" -I"D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native/ReactCommon/yoga" -isystem C:/Users/ASUS/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/folly_runtime/include -isystem C:/Users/ASUS/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/glog/include -isystem C:/Users/ASUS/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/jsi/include -isystem C:/Users/ASUS/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/reactnativejni/include -isystem C:/Users/ASUS/.gradle/caches/transforms-4/c7e26f7d3c2fc1a6636ff1467fc77795/transformed/jetified-fbjni-0.6.0/prefab/modules/fbjni/include -isystem C:/Users/ASUS/.gradle/caches/transforms-4/e7689cf58141a18272e612b148cefd59/transformed/jetified-hermes-android-0.74.1-debug/prefab/modules/libhermes/include -isystem C:/Users/ASUS/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/hermes_executor/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -DREACT_NATIVE_MINOR_VERSION=74 -DREANIMATED_VERSION=3.10.1 -DHERMES_ENABLE_DEBUGGER=1 -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++20 -Wall -Werror -DJS_RUNTIME_HERMES=1 -fno-limit-debug-info -fPIC -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1 -std=gnu++20 -MD -MT CMakeFiles/reanimated.dir/baa741105af35d3bc45a19e61592e3fd/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp.o -MF CMakeFiles\reanimated.dir\baa741105af35d3bc45a19e61592e3fd\Common\cpp\ReanimatedRuntime\WorkletRuntimeDecorator.cpp.o.d -o CMakeFiles/reanimated.dir/baa741105af35d3bc45a19e61592e3fd/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp.o -c "D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp"

D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp:115:29: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 115 | jsi::Value args[argsSize]; // NOLINT(runtime/arrays) | ^~~~ D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp:115:29: note: read of non-const variable 'argsSize' is not allowed in a constant expression D:/Final Cross-Platform/ElectronicsStore/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp:112:18: note: declared here 112 | auto argsSize = argsArray.size(rt); | ^ . I spend 2 days for this. How can i fix it?

adamjw24 commented 1 month ago

This has nothing to do with VVenC.