From 93d0f8c58dbe973f95f7e8b4f7a23dd4e97dd45b Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 30 Jan 2019 16:18:49 -0600 Subject: [PATCH] dfu: Fix build issue with gcc8 We get the following warning when buiding with gcc8: error: 'packed' attribute ignored for type 'u32_t *' {aka 'unsigned int *'} [-Werror=attributes] Use UNALIGNED_GET() to access the data since we don't know the alignment. Signed-off-by: Kumar Gala --- subsys/dfu/img_util/flash_img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/dfu/img_util/flash_img.c b/subsys/dfu/img_util/flash_img.c index 18d237edb5b..e1745a3beb3 100644 --- a/subsys/dfu/img_util/flash_img.c +++ b/subsys/dfu/img_util/flash_img.c @@ -42,7 +42,7 @@ static bool flash_verify(struct device *dev, off_t offset, if (memcmp(data, &temp, size)) { LOG_ERR("offset=0x%08"PRIx32" VERIFY FAIL. " "expected: 0x%08x, actual: 0x%08x", - (u32_t)offset, temp, *(__packed u32_t*)data); + (u32_t)offset, temp, UNALIGNED_GET(data)); break; } len -= size;