From: Vadim Troshchinskiy <vtroshchinskiy@qindel.com>
To: linux-usb@vger.kernel.org
Subject: usbip tools from 5.4 fail to build due to unaligned pointer value warning
Date: Fri, 29 Nov 2019 13:24:30 +0100 [thread overview]
Message-ID: <6296180.lmSoKh01SJ@gverdu.qindel.com> (raw)
Hello,
Building the usbip tools from 4.15 is failing under Fedora 30, gcc version
9.2.1:
$ make
make all-recursive
make[1]: Entering directory '/home/vadim/git/linux-orig/tools/usb/usbip'
Making all in libsrc
make[2]: Entering directory '/home/vadim/git/linux-orig/tools/usb/usbip/
libsrc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/vadim/git/linux-orig/tools/usb/usbip/libsrc'
Making all in src
make[2]: Entering directory '/home/vadim/git/linux-orig/tools/usb/usbip/src'
CC usbip_network.o
usbip_network.c: In function ‘usbip_net_pack_usb_device’:
usbip_network.c:79:32: error: taking address of packed member of ‘struct
usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-
of-packed-member]
79 | usbip_net_pack_uint32_t(pack, &udev->busnum);
| ^~~~~~~~~~~~~
usbip_network.c:80:32: error: taking address of packed member of ‘struct
usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-
of-packed-member]
80 | usbip_net_pack_uint32_t(pack, &udev->devnum);
| ^~~~~~~~~~~~~
usbip_network.c:81:32: error: taking address of packed member of ‘struct
usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-
of-packed-member]
81 | usbip_net_pack_uint32_t(pack, &udev->speed);
| ^~~~~~~~~~~~
usbip_network.c:83:32: error: taking address of packed member of ‘struct
usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-
of-packed-member]
83 | usbip_net_pack_uint16_t(pack, &udev->idVendor);
| ^~~~~~~~~~~~~~~
usbip_network.c:84:32: error: taking address of packed member of ‘struct
usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-
of-packed-member]
84 | usbip_net_pack_uint16_t(pack, &udev->idProduct);
| ^~~~~~~~~~~~~~~~
usbip_network.c:85:32: error: taking address of packed member of ‘struct
usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-
of-packed-member]
85 | usbip_net_pack_uint16_t(pack, &udev->bcdDevice);
| ^~~~~~~~~~~~~~~~
In file included from usbip_network.c:21:
usbip_network.c: In function ‘usbip_net_send_op_common’:
usbip_network.h:36:32: error: taking address of packed member of ‘struct
op_common’ may result in an unaligned pointer value [-Werror=address-of-
packed-member]
36 | usbip_net_pack_uint16_t(pack, &(op_common)->version);\
| ^~~~~~~~~~~~~~~~~~~~~
usbip_network.c:143:2: note: in expansion of macro ‘PACK_OP_COMMON’
143 | PACK_OP_COMMON(1, &op_common);
| ^~~~~~~~~~~~~~
usbip_network.h:37:32: error: taking address of packed member of ‘struct
op_common’ may result in an unaligned pointer value [-Werror=address-of-
packed-member]
37 | usbip_net_pack_uint16_t(pack, &(op_common)->code);\
| ^~~~~~~~~~~~~~~~~~
usbip_network.c:143:2: note: in expansion of macro ‘PACK_OP_COMMON’
143 | PACK_OP_COMMON(1, &op_common);
| ^~~~~~~~~~~~~~
usbip_network.h:38:32: error: taking address of packed member of ‘struct
op_common’ may result in an unaligned pointer value [-Werror=address-of-
packed-member]
38 | usbip_net_pack_uint32_t(pack, &(op_common)->status);\
| ^~~~~~~~~~~~~~~~~~~~
usbip_network.c:143:2: note: in expansion of macro ‘PACK_OP_COMMON’
143 | PACK_OP_COMMON(1, &op_common);
| ^~~~~~~~~~~~~~
usbip_network.c: In function ‘usbip_net_recv_op_common’:
usbip_network.h:36:32: error: taking address of packed member of ‘struct
op_common’ may result in an unaligned pointer value [-Werror=address-of-
packed-member]
36 | usbip_net_pack_uint16_t(pack, &(op_common)->version);\
| ^~~~~~~~~~~~~~~~~~~~~
usbip_network.c:167:2: note: in expansion of macro ‘PACK_OP_COMMON’
167 | PACK_OP_COMMON(0, &op_common);
| ^~~~~~~~~~~~~~
usbip_network.h:37:32: error: taking address of packed member of ‘struct
op_common’ may result in an unaligned pointer value [-Werror=address-of-
packed-member]
37 | usbip_net_pack_uint16_t(pack, &(op_common)->code);\
| ^~~~~~~~~~~~~~~~~~
usbip_network.c:167:2: note: in expansion of macro ‘PACK_OP_COMMON’
167 | PACK_OP_COMMON(0, &op_common);
| ^~~~~~~~~~~~~~
usbip_network.h:38:32: error: taking address of packed member of ‘struct
op_common’ may result in an unaligned pointer value [-Werror=address-of-
packed-member]
38 | usbip_net_pack_uint32_t(pack, &(op_common)->status);\
| ^~~~~~~~~~~~~~~~~~~~
usbip_network.c:167:2: note: in expansion of macro ‘PACK_OP_COMMON’
167 | PACK_OP_COMMON(0, &op_common);
| ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:430: usbip_network.o] Error 1
make[2]: Leaving directory '/home/vadim/git/linux-orig/tools/usb/usbip/src'
make[1]: *** [Makefile:497: all-recursive] Error 1
make[1]: Leaving directory '/home/vadim/git/linux-orig/tools/usb/usbip'
make: *** [Makefile:365: all] Error 2
It looks like this is due to gcc having added new warnings. For now I've
worked around it with -Wno-error=address-of-packed-member as I understand this
isn't a problem on x86.
next reply other threads:[~2019-11-29 12:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 12:24 Vadim Troshchinskiy [this message]
2019-11-29 13:33 ` usbip tools from 5.4 fail to build due to unaligned pointer value warning Greg KH
2019-11-29 13:49 ` Vadim Troshchinskiy
2019-11-29 14:17 ` Greg KH
2019-12-03 9:41 ` Vadim Troshchinskiy
2019-12-10 10:25 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6296180.lmSoKh01SJ@gverdu.qindel.com \
--to=vtroshchinskiy@qindel.com \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).