base: Allocating struct pldm_msg with member initialization
Avoid allocating struct pldm_msg without member initialization in
PLDM_MSG_DEFINE_P. Otherwise unit tests may fail with
-Werror=maybe-uninitialized.
Change-Id: I3d0118a0067e373dc7bd2fd9b28eec2fdf5780e4
Signed-off-by: John Chung <john.chung@arm.com>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 374c9de..ca92291 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -82,6 +82,9 @@
- dsp: base: Don't extract MultipartReceive resp's CRC once complete
+- base: Allocating struct pldm_msg with member initialization in
+ PLDM_MSG_DEFINE_P.
+
### Security
## [0.14.0] 2025-08-11
diff --git a/include/libpldm/base.h b/include/libpldm/base.h
index 83a3336..573fc8b 100644
--- a/include/libpldm/base.h
+++ b/include/libpldm/base.h
@@ -255,7 +255,7 @@
#ifdef __cplusplus
#define PLDM_MSG_DEFINE_P(name, size) \
PLDM_MSG_BUFFER(name##_buf, size); \
- auto *(name) = new (name##_buf) pldm_msg
+ auto *(name) = new (name##_buf) pldm_msg()
#endif
/**