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

tests/drivers/build_all/wifi fails on native_sim/native/64 #80242

Open
danieldegrasse opened this issue Oct 22, 2024 · 0 comments · May be fixed by #80243
Open

tests/drivers/build_all/wifi fails on native_sim/native/64 #80242

danieldegrasse opened this issue Oct 22, 2024 · 0 comments · May be fixed by #80243
Assignees
Labels
area: Wi-Fi Wi-Fi bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@danieldegrasse
Copy link
Collaborator

Describe the bug
The WiFi driver build all test added in #79145 is failing to build on native_sim/native/64, due to some issues regarding 64 bit versus 32 bit pointers in the eswifi driver.

To Reproduce

  1. west build -p -b native_sim/native/64 tests/drivers/build_all/wifi -T drivers.wifi.build.uart
  2. See build warning (upgraded to error in CI)

Expected behavior
The build should pass without warnings

Impact
Blocking CI on #72102

Logs and console output

[118/162] Building C object zephyr/drivers/wifi/CM...ivers__wifi.dir/eswifi/eswifi_socket_offload.c.obj
/home/danieldegrasse/zephyr/zephyrproject/zephyr/drivers/wifi/eswifi/eswifi_socket_offload.c: In function ‘eswifi_socket_connect’:
/home/danieldegrasse/zephyr/zephyrproject/zephyr/drivers/wifi/eswifi/eswifi_socket_offload.c:31:26: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   31 | #define OBJ_TO_SD(obj) (((int)obj) - 1)
      |                          ^
/home/danieldegrasse/zephyr/zephyrproject/zephyr/drivers/wifi/eswifi/eswifi_socket_offload.c:58:20: note: in expansion of macro ‘OBJ_TO_SD’
   58 |         int sock = OBJ_TO_SD(obj);
      |                    ^~~~~~~~~
/home/danieldegrasse/zephyr/zephyrproject/zephyr/drivers/wifi/eswifi/eswifi_socket_offload.c: In function ‘eswifi_socket_listen’:
/home/danieldegrasse/zephyr/zephyrproject/zephyr/drivers/wifi/eswifi/eswifi_socket_offload.c:31:26: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   31 | #define OBJ_TO_SD(obj) (((int)obj) - 1)

Several similar warnings are present in the file.

Environment (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • Toolchain: zephyr-sdk-0.17.0-rc1
  • Commit SHA or Version used 6e653a9 (main)
@danieldegrasse danieldegrasse added the bug The issue is a bug, or the PR is fixing a bug label Oct 22, 2024
danieldegrasse added a commit to nxp-upstream/zephyr that referenced this issue Oct 22, 2024
The eswifi driver uses an integer to identify the socket used for each
connection, which must be cast to and from a `void *`. This causes
warnings on 64 bit platforms, as precision is lost when casting from a
`void *` to `int`. Use a `uintptr_t` type to store the socket value to
resolve this warning. Also, fix a function signature for the `accept_cb`
to use `size_t` instead of `int` for the length

Fixes zephyrproject-rtos#80242

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
@henrikbrixandersen henrikbrixandersen added the priority: medium Medium impact/importance bug label Oct 22, 2024
danieldegrasse added a commit to nxp-upstream/zephyr that referenced this issue Oct 22, 2024
The eswifi driver uses an integer to identify the socket used for each
connection, which must be cast to and from a `void *`. This causes
warnings on 64 bit platforms, as precision is lost when casting from a
`void *` to `int`. Use a `intptr_t` type to store the socket value to
resolve this warning. Also, fix a function signature for the `accept_cb`
to use `size_t` instead of `int` for the length

Fixes zephyrproject-rtos#80242

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Wi-Fi Wi-Fi bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants