mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-14 08:21:27 -04:00
tiocswinsz: fix compilation error on e.g. ppc64
On some platforms, TIOCSWINSZ has a very large value, > 0x80000000. On some platforms, the `request` argument to `ioctl(3)` is an `int`. For platforms where both of the above is true, gcc will warn (and error out if compiled with `-Werror`) on: ioctl(fd, TIOCSWINSZ, ...) To silence this warning, we need to cast `TIOCSWINSZ` to an integer. However, doing this on platforms where `request` is an `unsigned long` will result in `TIOCSWINSZ` being sign-extended (and thus we end up with an invalid value). It seems that casting to `unsigned int` works in both cases; it silences the long -> int conversion warning, while also preserving the correct value in all cases.
This commit is contained in:
parent
d31139515f
commit
273f105af5
3 changed files with 5 additions and 2 deletions
|
|
@ -26,6 +26,9 @@
|
|||
* XCursor shape in CSD corners when window is tiled.
|
||||
* Error handling when processing keyboard input (maybe
|
||||
https://codeberg.org/dnkl/foot/issues/171).
|
||||
* Compilation error _"overflow in conversion from long 'unsigned int'
|
||||
to 'int' changes value... "_ seen on platforms where the `request`
|
||||
argument in `ioctl(3)` is an `int` (for example: linux/ppc64).
|
||||
|
||||
|
||||
## 1.5.2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue