diff mbox series

[2/6] umbim: fix compilation with GCC 10

Message ID 20210815105119.3035569-3-stijn@linux-ipv6.be
State Accepted
Delegated to: Stijn Tintel
Headers show
Series use binutils 2.36.1 and gcc 10 by default | expand

Commit Message

Stijn Tintel Aug. 15, 2021, 10:51 a.m. UTC
When building umbim with GCC 10, a bunch of these errors appear:

cli.c: In function 'mbim_device_caps_response':
cli.c:55:29: error: taking address of packed member of 'struct mbim_basic_connect_device_caps_r' may result in an unaligned pointer value [-Werror=address-of-packed-member]
   55 |  deviceid = mbim_get_string(&caps->deviceid, buffer);
      |                             ^~~~~~~~~~~~~~~

Fix them by disabling padding between fields of struct mbim_string.

This change will be committed to umbim.git and the package bumped in
OpenWrt instead, after being acked.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
---
 package/network/utils/umbim/patches/999-gcc10.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 package/network/utils/umbim/patches/999-gcc10.patch
diff mbox series

Patch

diff --git a/package/network/utils/umbim/patches/999-gcc10.patch b/package/network/utils/umbim/patches/999-gcc10.patch
new file mode 100644
index 0000000000..7fdc410393
--- /dev/null
+++ b/package/network/utils/umbim/patches/999-gcc10.patch
@@ -0,0 +1,13 @@ 
+diff --git a/mbim-type.h b/mbim-type.h
+index ddc36fa..fdbe684 100644
+--- a/mbim-type.h
++++ b/mbim-type.h
+@@ -18,7 +18,7 @@
+ struct mbim_string {
+ 	uint32_t offset;
+ 	uint32_t length;
+-};
++} __attribute__((packed));
+ 
+ struct mbim_enum {
+ 	uint32_t key;