wok-current view efivar/stuff/0004-Fix-another-error-of-Werror-address-of-packed-member.patch @ rev 25788
Mass update to fix build with gcc10 and up others packages
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Tue Sep 30 07:43:04 2025 +0000 (7 days ago) |
parents | |
children |
line source
1 From 0dad6d78a7fb5f6c5fb4a1d646040539db6cf865 Mon Sep 17 00:00:00 2001
2 From: Chih-Wei Huang <cwhuang@linux.org.tw>
3 Date: Tue, 26 Feb 2019 18:42:20 +0800
4 Subject: [PATCH] Fix another error of -Werror=address-of-packed-member
6 Android 9 clang complains:
8 external/efivar/src/dp-message.c:367:24: error: taking address of packed member '' of class or structure 'efidp_infiniband' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
9 (efi_guid_t *)&dp->infiniband.ioc_guid);
10 ^~~~~~~~~~~~~~~~~~~~~~~
11 external/efivar/src/dp.h:76:19: note: expanded from macro 'format_guid'
12 memmove(&_guid, guid, sizeof(_guid)); \
13 ^~~~
14 1 error generated.
16 Since commit c3c553d the fifth parameter of format_guid() is treated as
17 a const void *. The casting is unnecessary.
19 Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
20 [james.hilliard1@gmail.com: backport from upstream commit
21 0dad6d78a7fb5f6c5fb4a1d646040539db6cf865]
22 Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
23 ---
24 src/dp-media.c | 3 +--
25 src/dp-message.c | 2 +-
26 2 files changed, 2 insertions(+), 3 deletions(-)
28 diff --git a/src/dp-media.c b/src/dp-media.c
29 index 96a576f..be691c4 100644
30 --- a/src/dp-media.c
31 +++ b/src/dp-media.c
32 @@ -46,8 +46,7 @@ _format_media_dn(char *buf, size_t size, const_efidp dp)
33 break;
34 case EFIDP_HD_SIGNATURE_GUID:
35 format(buf, size, off, "HD", "GPT,");
36 - format_guid(buf, size, off, "HD",
37 - (efi_guid_t *)dp->hd.signature);
38 + format_guid(buf, size, off, "HD", dp->hd.signature);
39 format(buf, size, off, "HD",
40 ",0x%"PRIx64",0x%"PRIx64")",
41 dp->hd.start, dp->hd.size);
42 diff --git a/src/dp-message.c b/src/dp-message.c
43 index 9f96466..6b8e907 100644
44 --- a/src/dp-message.c
45 +++ b/src/dp-message.c
46 @@ -364,7 +364,7 @@ _format_message_dn(char *buf, size_t size, const_efidp dp)
47 dp->infiniband.port_gid[1],
48 dp->infiniband.port_gid[0]);
49 format_guid(buf, size, off, "Infiniband",
50 - (efi_guid_t *)&dp->infiniband.ioc_guid);
51 + &dp->infiniband.ioc_guid);
52 format(buf, size, off, "Infiniband",
53 ",%"PRIu64",%"PRIu64")",
54 dp->infiniband.target_port_id,
55 --
56 2.20.1