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

Having -Wincompatible-pointer-types when building with CONFIG_ZMK_USB=y #2794

Open
mlouielu opened this issue Jan 24, 2025 · 0 comments · May be fixed by #2795
Open

Having -Wincompatible-pointer-types when building with CONFIG_ZMK_USB=y #2794

mlouielu opened this issue Jan 24, 2025 · 0 comments · May be fixed by #2795

Comments

@mlouielu
Copy link

When enabled CONFIG_ZMK_USB=y, the following error -Wincompatible-pointer-types shows:

/zmk/app/src/usb_hid.c: In function ‘get_report_cb’:
/zmk/app/src/usb_hid.c:92:41: error: passing argument 1 of ‘get_keyboard_report’ from incompatible pointer type [-Wincompatible-pointer-types]
   92 |             *data = get_keyboard_report(len);
      |                                         ^~~
      |                                         |
      |                                         int32_t * {aka int *}
compilation terminated due to -Wfatal-errors.

Example

$ echo "CONFIG_ZMK_USB=y" > tests/none/normal/native_posix_64.conf
$ west build --pristine --board native_posix_64 -- -DZMK_CONFIG=tests/none/normal/
...
/zmk/app/src/usb_hid.c:92:41: error: passing argument 1 of ‘get_keyboard_report’ from incompatible pointer type [-Wincompatible-pointer-types]
...
mlouielu added a commit to mlouielu/zmk that referenced this issue Jan 24, 2025
Fix zmkfirmware#2794, where `get_keyboard_report(len)` didn't convert
`len` from `int32_t *` to `size_t *`.
@mlouielu mlouielu linked a pull request Jan 24, 2025 that will close this issue
5 tasks
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 a pull request may close this issue.

1 participant