From 59b40edeabcffa51c45fb1775feff5fdbc1bf2df Mon Sep 17 00:00:00 2001 From: Ammar ELWazir Date: Tue, 14 Nov 2023 11:00:22 -0600 Subject: [PATCH] Not all compilers are able to work with .VAR inside a struct (#209) * Not all compilers are able to work with .VAR inside a struct * source formatting (clang-format v11) (#210) Co-authored-by: ammarwa --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: ammarwa [ROCm/rocprofiler-sdk commit: 8f73db5b1c9ffa66e03fcf1c7a375695ab77d6a1] --- .../source/lib/common/container/record_header_buffer.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/rocprofiler-sdk/source/lib/common/container/record_header_buffer.hpp b/projects/rocprofiler-sdk/source/lib/common/container/record_header_buffer.hpp index 5591dfefe6..42784ea640 100644 --- a/projects/rocprofiler-sdk/source/lib/common/container/record_header_buffer.hpp +++ b/projects/rocprofiler-sdk/source/lib/common/container/record_header_buffer.hpp @@ -261,9 +261,11 @@ record_header_buffer::emplace(uint32_t _category, uint32_t _kind, Tp& _v) // for where the header record should be placed. // NOTE: m_headers was resized to be large enough to accomodate // sizeof(Tp) == 1 for every entry in buffer - auto idx = m_index.fetch_add(1, std::memory_order_release); - m_headers.at(idx) = - rocprofiler_record_header_t{.category = _category, .kind = _kind, .payload = _addr}; + auto idx = m_index.fetch_add(1, std::memory_order_release); + m_headers.at(idx) = rocprofiler_record_header_t{}; + m_headers.at(idx).category = _category; + m_headers.at(idx).kind = _kind; + m_headers.at(idx).payload = _addr; } read_unlock(); return (_addr != nullptr);