aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspreis <spreis@yandex-team.com>2023-02-17 18:29:27 +0300
committerspreis <spreis@yandex-team.com>2023-02-17 18:29:27 +0300
commit458c063b727f8f733c8d546deeadc8025a5eb8b9 (patch)
tree91c28705d7ba963cb32580fe596b5764333689f4
parent89a005ec19bcf5d071d64a518bb38b836a3be392 (diff)
downloadydb-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.h4
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|