CESARBR / CESARBR/knot-hal-source

Error compiling with gcc 9.2.1

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
5
Forks
24
PR merge metrics
No merged PRs in 30d

Description

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'`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.