# Re: termios constants should be unsigned

- From: Alejandro Colomar \<alx@kernel.org\>
- Date: 2024-06-12 19:01:44 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2024/06/13330290
- Thread: https://ratatoskr.run/linux-api/2024/06/13330278/t.md

```text
On Wed, Jun 12, 2024 at 01:47:03PM GMT, enh wrote:
> hacked these changes into AOSP, and it did break one bit of existing
> code that was already working around the sign differences --- this
> warning was enabled but the code had a cast to make the _other_ side
> of the comparison signed (rather than make this side of the comparison
> unsigned).

BTW, that seems to be a bogus way to workaround this; the cast should
have been on the other side.  I'd say whoever maintains that code should
probably fix that to use unsigned types.  These constants are meant to
be 'tcflag_t', so a cast should be to that type, or the type of the
other side of the comparison, but casting to 'int' just for silencing a
waring seems nuts.

This makes me wonder if breaking _those_ users could be a good thing...

-- 
<https://www.alejandro-colomar.es/>
```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-api/2024/06/13330290/attachment/0) (application/pgp-signature, 833 bytes)
