Failing to compile on Arch Linux (with temporary solution)
3urobeat opened this issue · comments
Hey, the driver does not seem to compile anymore since 45074ab for me.
Errors:
/home/tomg/Desktop/CH341SER/ch34x.c:1292:27: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
1292 | .write_room = ch34x_write_room,
| ^~~~~~~~~~~~~~~~
/home/tomg/Desktop/CH341SER/ch34x.c:1292:27: note: (near initialization for ‘ch34x_device.write_room’)
/home/tomg/Desktop/CH341SER/ch34x.c:1293:28: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
1293 | .chars_in_buffer = ch34x_chars_in_buffer,
| ^~~~~~~~~~~~~~~~~~~~~
/home/tomg/Desktop/CH341SER/ch34x.c:1293:28: note: (near initialization for ‘ch34x_device.chars_in_buffer’)
Reverting the change from 45074ab suggested in #14 by changing the type of ch34x_write_room
and ch34x_chars_in_buffer
back to unsigned int
instead of int
seems to resolve the issue for me for now.
Arch Linux, Kernel: 5.14.14-zen1-1-zen
(All packages up to date and rebooted)
tomorrow I'll use newer kernel, different version of gcc and I'll let you know what's next - if there will be big differences between distributions, I will have to take into account disabling "-Werror=incompatible-pointer-types"...
Could you see if this solution works for you?
I have tested for both cases - when there is a newer kernel with gcc and an older one, and it looks like the condition from the pull request adjusts correctly. Nevertheless, it would be good if others would confirm this. Users no longer need to clone the repo from @sirlucjan if they don't want to, because the changes were accepted in the pull request
Ok, thank you