diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-10-29 17:06:04 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-11-06 19:08:52 +0000 |
| commit | 273f105af5861e35f58b6a37e9b1b576dd9adaec (patch) | |
| tree | 8fd91d7a80e35fb1c939b28ce5f3ec896e59a068 /CHANGELOG.md | |
| parent | main: remove trailing ‘, ’ from arch log line (diff) | |
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.
Diffstat (limited to 'CHANGELOG.md')
| -rw-r--r-- | CHANGELOG.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c0d03aa..02cab39e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 |
