From 7cd420649f9f68e3833ddf968ec9f39d0b9a0e57 Mon Sep 17 00:00:00 2001 From: Siva Chandra Reddy Date: Wed, 27 Jan 2021 01:18:58 -0800 Subject: [PATCH] [libc][NFC] Use a end of list marker for cpu feature detection. Without this, the array can end up being an empty array leading to compiler failures. --- libc/cmake/modules/cpu_features/check_cpu_features.cpp.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libc/cmake/modules/cpu_features/check_cpu_features.cpp.in b/libc/cmake/modules/cpu_features/check_cpu_features.cpp.in index 25f67a63e192..3771129b4a56 100644 --- a/libc/cmake/modules/cpu_features/check_cpu_features.cpp.in +++ b/libc/cmake/modules/cpu_features/check_cpu_features.cpp.in @@ -18,6 +18,9 @@ int main(int, char **) { const char *strings[] = { @DEFINITIONS@ + // If DEFINITIONS turns out to be empty, we don't want to list + // an empty array. So, we add an end of list marker. + "" }; const size_t size = sizeof(strings) / sizeof(strings[0]); for (size_t i = 0; i < size; ++i) {