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

From: Vincent Lefevre <vincent_AT_vinc17.net>
Date: Sat, 15 Jun 2024 18:10:50 +0200

On 2024-06-15 16:24:38 +0200, Mattias Andrée wrote:
> No, you should use [u]int_least1_t, except that probably doesn't
> exist,

So, you must not use it. :)

On the opposite, int_least8_t is a *required* type in ISO C99+.
That's why I've proposed 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.

IMHO, this has been poorly designed. There should have been a macro
taking a parameter N (an integer constant expression), where the
type would have been valid for any N up to the maximum width (thus
at least 64). For portability, the existence of the macro could have
also been tested with #ifdef, allowing a fallback.

-- 
Vincent Lefèvre <vincent_AT_vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Received on Sat Jun 15 2024 - 18:10:50 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 15 2024 - 18:12:10 CEST