From 58ae321b263c87a64eb42152bb0191e791594b37 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Thu, 28 Mar 2024 17:39:28 +0000 Subject: [PATCH] Try and fix the clearing an object of non-trivial type error --- libs/acn/RPTInflatorTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/acn/RPTInflatorTest.cpp b/libs/acn/RPTInflatorTest.cpp index 931c78b06..f349e53ee 100644 --- a/libs/acn/RPTInflatorTest.cpp +++ b/libs/acn/RPTInflatorTest.cpp @@ -60,7 +60,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION(RPTInflatorTest); */ void RPTInflatorTest::testDecodeHeader() { RPTHeader::rpt_pdu_header header; - memset(&header, 0, sizeof(header)); + // Need to cast the header before we memset as it's got a constructor to + // ensure the reserved value is set to zero by default + memset(reinterpret_cast(&header), 0, sizeof(header)); RPTInflator inflator; HeaderSet header_set, header_set2; unsigned int bytes_used;