memset will clear std::atomic
Closed this issue · 2 comments
madebr commented
On
Line 1050 in bca802b
and
Line 1222 in bca802b
An object of
MicroProfileThreadLog
is cleared.
This operation is unsafe because the std::atomic
in there have no trivial copy-assignment.
/home/maarten/programming/openrw/external/microprofile/microprofile/microprofile.cpp:1221: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct MicroProfileThreadLog’ with no trivial copy-assignment; use value-initialization instead [-Wclass-memaccess]
memset(pLog, 0, sizeof(*pLog));
^
jonasmr commented
Isn't this just the compiler being silly?
Does a platform actually exist where this is a problem?