diff options
author | spreis <spreis@yandex-team.com> | 2023-02-17 18:29:27 +0300 |
---|---|---|
committer | spreis <spreis@yandex-team.com> | 2023-02-17 18:29:27 +0300 |
commit | 458c063b727f8f733c8d546deeadc8025a5eb8b9 (patch) | |
tree | 91c28705d7ba963cb32580fe596b5764333689f4 | |
parent | 89a005ec19bcf5d071d64a518bb38b836a3be392 (diff) | |
download | ydb-458c063b727f8f733c8d546deeadc8025a5eb8b9.tar.gz |
Fix build using cl.exe
https://en.cppreference.com/w/c/language/array
`Zero-length array declarations are not allowed, even though some compilers offer them as extensions (typically as a pre-C99 implementation of flexible array members).`
This is needed to build catboost for Windows.
-rw-r--r-- | library/cpp/yt/memory/chunked_memory_allocator.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/library/cpp/yt/memory/chunked_memory_allocator.h b/library/cpp/yt/memory/chunked_memory_allocator.h index 33559d8aa7..4804a969cf 100644 --- a/library/cpp/yt/memory/chunked_memory_allocator.h +++ b/library/cpp/yt/memory/chunked_memory_allocator.h @@ -44,7 +44,9 @@ private: const i64 MaxSmallBlockSize_; const TRefCountedTypeCookie TagCookie_; - char EmptyBuf_[0]; + // Zero-sized arrays are prohibited by C++ standard + // Also even if supported they actually occupy some space (usually 1 byte) + char EmptyBuf_[1]; // Chunk memory layout: // |AAAA|....|UUUU| |