Re: [dev] [dwm][st] why use ints over bools?

From: Mattias Andrée <maandree_AT_kth.se>
Date: Sat, 15 Jun 2024 16:24:38 +0200

No, you should use [u]int_least1_t, except that probably doesn't
exist, so char is best as it is per definition the most narrow type,
and if the signness is important you can specify it.

I think C actually should add some what to specify
[u]int_{least,fast}N_t for arbitrary N. It could be simple as
libc having to enumerate all up to some N. But it's a bit silly
that [u]int_{least,fast}N_t (expecially [u]int_leastN_t) exists
only for 8, 16, 32, and 64, when the machine probably has integers
with those exact widths anyways.


On Sat, 15 Jun 2024 16:14:58 +0200
Vincent Lefevre <vincent_AT_vinc17.net> wrote:

> On 2024-06-15 17:05:27 +0300, stefan11111 wrote:
> > What about using char's then?
>
> char may be signed or unsigned. I would suggest unsigned char or
> signed char, or better, (u)int_least8_t.
>
Received on Sat Jun 15 2024 - 16:24:38 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 15 2024 - 17:12:08 CEST