Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling with gcc 9.2.1 #1

Open
k-cabral opened this issue Jan 14, 2020 · 0 comments
Open

Error compiling with gcc 9.2.1 #1

k-cabral opened this issue Jan 14, 2020 · 0 comments

Comments

@k-cabral
Copy link

Make failed with gcc version 9.2.1 on Ubuntu 19.10

Making all in src/hal/comm
  CC       libhalcommnrf24_la-comm_nrf24l01.lo
comm_nrf24l01.c: In function ‘read_mgmt’:
comm_nrf24l01.c:496:12: error: taking address of packed member of ‘struct nrf24_ll_mgmt_connect’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
  496 |   DBG_RECV(&llc->src_addr, &llc->dst_addr, (const uint8_t *) ipdu, ilen);
      |            ^~~~~~~~~~~~~~
comm_nrf24l01.c:194:50: note: in definition of macro ‘DBG_RECV’
  194 | #define DBG_RECV(mac1, mac2, pdu, len)  DBG('<', mac1, mac2, pdu, len)
      |                                                  ^~~~
comm_nrf24l01.c:496:28: error: taking address of packed member of ‘struct nrf24_ll_mgmt_connect’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
  496 |   DBG_RECV(&llc->src_addr, &llc->dst_addr, (const uint8_t *) ipdu, ilen);
      |                            ^~~~~~~~~~~~~~
comm_nrf24l01.c:194:56: note: in definition of macro ‘DBG_RECV’
  194 | #define DBG_RECV(mac1, mac2, pdu, len)  DBG('<', mac1, mac2, pdu, len)
      |                                                        ^~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:410: libhalcommnrf24_la-comm_nrf24l01.lo] Error 1
make[1]: *** [Makefile:940: all-recursive] Error 1
make: *** [Makefile:549: all] Error 2

gcc 7.4.0 worked fine
$ sudo apt-get install gcc-7
$ make 'CC=gcc-7'

k-cabral added a commit to k-cabral/knot-hal-source that referenced this issue Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant