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

initialization of ‘unsigned int - Werror=incompatible-pointer-types #39

Open
JoseBarreto1 opened this issue Apr 6, 2023 · 1 comment

Comments

@JoseBarreto1
Copy link

When running the make command, I came across the following errors:

error: initialization of ‘unsigned int (*)(struct tty_struct )’ from incompatible pointer type ‘int ()(struct tty_struct )’ [-Werror=incompatible-pointer-types]
1304 | .write_room = ch34x_write_room,
| ^~~~~~~~~~~~~~~~
/home/ti/Downloads/CH341SER-master/ch34x.c:1304:20: note: (near initialization for ‘ch34x_device.write_room’)
/home/ti/Downloads/CH341SER-master/ch34x.c:1305:21: error: initialization of ‘unsigned int (
)(struct tty_struct )’ from incompatible pointer type ‘int ()(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
1305 | .chars_in_buffer = ch34x_chars_in_buffer,
| ^~~~~~~~~~~~~~~~~~~~~
/home/ti/Downloads/CH341SER-master/ch34x.c:1305:21: note: (near initialization for ‘ch34x_device.chars_in_buffer’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:297: /home/ti/Downloads/CH341SER-master/ch34x.o] Erro 1
make[1]: *** [Makefile:1906: /home/ti/Downloads/CH341SER-master] Erro 2
make[1]: Saindo do diretório '/usr/src/linux-headers-5.15.0-69-generic'
make: *** [Makefile:7: default] Erro 2

@CyboMer
Copy link

CyboMer commented May 10, 2023

I got a similar error as this. I simply changed the two lines where ch34x_write_room is called from int to unsigned int (lines 942 and 946 for me respectively). This fixed the error. Same thing for the ch34x_chars_in_buffer (lines 968 and 972 for me respectively).

Your lines may be slightly different but the solution should be the same. Hope this helps!

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

2 participants