Skip to content

Commit 7cd4206

Browse files
author
Siva Chandra Reddy
committed
[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.
1 parent 498c4b6 commit 7cd4206

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libc/cmake/modules/cpu_features/check_cpu_features.cpp.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
int main(int, char **) {
1919
const char *strings[] = {
2020
@DEFINITIONS@
21+
// If DEFINITIONS turns out to be empty, we don't want to list
22+
// an empty array. So, we add an end of list marker.
23+
"<end_of_feature_list>"
2124
};
2225
const size_t size = sizeof(strings) / sizeof(strings[0]);
2326
for (size_t i = 0; i < size; ++i) {

0 commit comments

Comments
 (0)