Suppress memcpy writing to an object with no trivial copy-assignment warnings

We need to copy padding in most of these cases, and the objects are trivially copyable; however, BitField prevents trivial copy-assignment.
This commit is contained in:
Pokechu22
2023-02-02 16:53:08 -08:00
parent ac7a17579e
commit 3024ca2146
6 changed files with 49 additions and 0 deletions

View File

@ -101,7 +101,14 @@ void FifoPlaybackAnalyzer::AnalyzeFrames(FifoDataFile* file,
part_start = offset;
// Copy cpmem now, because end_of_primitives isn't triggered until the first opcode after
// primitive data, and the first opcode might update cpmem
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
std::memcpy(&cpmem, &analyzer.m_cpmem, sizeof(CPState));
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
}
if (analyzer.m_end_of_primitives)
{