Hi, i have a compile problem with Clang 20.1 ! Older versions of Clang can compile the…
- User
Hi, i have a compile problem with Clang 20.1 ! Older versions of Clang can compile the file 3rdparty\bgfx\3rdparty\dear-imgui\imgui.h. See here https://raw.githubusercontent.com/mamedev/mame/refs/heads/master/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
The compile error is this here:
Clang 20.1.0 detected Compiling 3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp... In file included from ../../../../../3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp:856: ../../../../../3rdparty/bgfx/3rdparty/dear-imgui/imgui.h:2451:43: error: first argument in call to 'memset' is a pointer to non-trivially copyable type 'ImDrawListSplitter' [-Werror,-Wnontrivial-memcall] 2451 | inline ImDrawListSplitter() { memset(this, 0, sizeof(this)); } | ^ ../../../../../3rdparty/bgfx/3rdparty/dear-imgui/imgui.h:2451:43: note: explicitly cast the pointer to silence this warning 2451 | inline ImDrawListSplitter() { memset(this, 0, sizeof(this)); } | ^ | (void) ../../../../../3rdparty/bgfx/3rdparty/dear-imgui/imgui.h:2522:60: error: first argument in call to 'memset' is a pointer to non-trivially copyable type 'ImDrawList' [-Werror,-Wnontrivial-memcall] 2522 | ImDrawList(ImDrawListSharedData shared_data) { memset(this, 0, sizeof(this)); _Data = shared_data; } | ^ ../../../../../3rdparty/bgfx/3rdparty/dear-imgui/imgui.h:2522:60: note: explicitly cast the pointer to silence this warning 2522 | ImDrawList(ImDrawListSharedData shared_data) { memset(this, 0, sizeof(this)); _Data = shared_data; } | ^ | (void)
This is the code at line 2443:
// Split/Merge functions are used to split the draw list into different layers which can be drawn into out of order. // This is used by the Columns/Tables API, so items of each column can be batched together in a same draw call. struct ImDrawListSplitter { int _Current; // Current channel number (0) int _Count; // Number of active channels (1+) ImVector _Channels; // Draw channels (not resized down so _Count might be < Channels.Size)
code - Assistant