mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 12:23:15 +00:00
AK: Explicitly initialize buffer member in ByteBuffer
When compiling the Kernel with Og, the compiler complains that m_outline_capacity might be uninitialized when calling capacity() Note that this fix is not really what we want. Ideally only outline buffer and outline capacity would need initialized, not the entire inline buffer. However, clang considers the class to not be default-constructible if we make that change, while gcc accepts it.
This commit is contained in:
parent
8146543a43
commit
6459c5a713
|
@ -235,7 +235,7 @@ private:
|
|||
|
||||
size_t m_size { 0 };
|
||||
union {
|
||||
u8 m_inline_buffer[inline_capacity];
|
||||
u8 m_inline_buffer[inline_capacity] {};
|
||||
struct {
|
||||
u8* m_outline_buffer;
|
||||
size_t m_outline_capacity;
|
||||
|
|
Loading…
Reference in a new issue