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

Fix:mac_lld_init build error, '__eth_rb' will never be NULL #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Huibean
Copy link
Member

@Huibean Huibean commented Jan 25, 2025

To fix a compile error happen on hardware target with ETH driver, gcc12.2 with Pixhawk v6x and CUAV Nano7

[11/12] Linking build/Pixhawk6X/modules/ChibiOS/libch.a
[1/1] ChibiOS: Compiling hal_mac_lld.c

../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c: In function 'mac_lld_init':
../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c:283:16: error: the comparison will always evaluate as 'false' for the address of '__eth_rb' will never be NULL [-Werror=address]
  283 |   if (__eth_rb == NULL || __eth_tb == NULL || __eth_rd == NULL || __eth_td == NULL) {
      |                ^~
../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c:130:18: note: '__eth_rb' declared here
  130 | extern uint32_t *__eth_rb[STM32_MAC_RECEIVE_BUFFERS];
      |                  ^~~~~~~~
../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c:283:36: error: the comparison will always evaluate as 'false' for the address of '__eth_tb' will never be NULL [-Werror=address]
  283 |   if (__eth_rb == NULL || __eth_tb == NULL || __eth_rd == NULL || __eth_td == NULL) {
      |                                    ^~
../../modules/ChibiOS/os/hal/ports/STM32/LLD/MACv2/hal_mac_lld.c:131:18: note: '__eth_tb' declared here
  131 | extern uint32_t *__eth_tb[STM32_MAC_TRANSMIT_BUFFERS];
      |                  ^~~~~~~~
cc1: all warnings being treated as errors
make: *** [modules/ChibiOS/obj/hal_mac_lld.o] Error 1

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

Successfully merging this pull request may close these issues.

1 participant