diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-10-29 17:06:04 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-10-29 17:06:04 +0000 |
| commit | beaf220f394984c97395b079eab260b225ee5378 (patch) | |
| tree | 50cc25e8e8f01622ec95d99a075338e3cca617b1 /input.c | |
| parent | Merge branch 'drag-and-drop' (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 'input.c')
0 files changed, 0 insertions, 0 deletions
