From bc860af08783b8113005ca7697da5f5d49a8056f Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Fri, 5 May 2023 11:04:05 -0700 Subject: [PATCH] This trips up when compiling with -Wvla otherwise. PiperOrigin-RevId: 529762901 Change-Id: I6ce4d630191bf265f847aef2d5dcc12a712faa60 --- googletest/src/gtest-port.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index 77b618c4..2aaf2bcc 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -199,8 +199,8 @@ size_t GetThreadCount() { mib[5] = static_cast(size / static_cast(mib[4])); // populate array of structs - struct kinfo_proc info[mib[5]]; - if (sysctl(mib, miblen, &info, &size, NULL, 0)) { + std::vector info(mib[5]); + if (sysctl(mib, miblen, info.data(), &size, NULL, 0)) { return 0; }