From a801128551768db313f7753d11fca605980285fa Mon Sep 17 00:00:00 2001 From: Christian Despres Date: Tue, 10 Dec 2024 10:20:11 -0500 Subject: [PATCH] Fix variable-length array warning in clang The maxCount parameter is a dynamic quantity, and creating an array of that length in C++ causes a warning-as-error with Clang 18. Signed-off-by: Christian Despres --- runtime/compiler/control/JITClientCompilationThread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/compiler/control/JITClientCompilationThread.cpp b/runtime/compiler/control/JITClientCompilationThread.cpp index c6f0c1e4fa7..ecef29f67ec 100644 --- a/runtime/compiler/control/JITClientCompilationThread.cpp +++ b/runtime/compiler/control/JITClientCompilationThread.cpp @@ -1901,12 +1901,12 @@ handleServerMessage(JITServer::ClientStream *client, TR_J9VM *fe, JITServer::Mes TR_ResolvedJ9Method *callerMethod = std::get<3>(recv); TR_YesNoMaybe useGetResolvedInterfaceMethod = std::get<4>(recv); - TR_ResolvedMethod *implArray[maxCount]; + std::vector implArray(maxCount, NULL); TR_PersistentClassInfo *classInfo = comp->getPersistentInfo()->getPersistentCHTable()->findClassInfoAfterLocking(clazz, comp, true); int32_t implCount = TR_ClassQueries::collectImplementorsCapped( classInfo, - implArray, + implArray.data(), maxCount, slotOrIndex, callerMethod,