Re: [PATCH v2 1/4] system_data_types.7: Add int_leastN_t family of types

Alejandro Colomar
2020-10-02T08:35:25Z

Hi Paul,

On 2020-10-01 19:38, Paul Eggert wrote:
> On 10/1/20 7:35 AM, Alejandro Colomar via Libc-alpha wrote:
>> +The narrowest signed integer type
>> +of a width of at least N bits,
>
> Motivation is missing here. Why is there an int_leastN_t type at all?

Well, I'd say the motivation is for the standard to allow
unicorn implementations that have types that are not of normal widths
For example, this allows an implementation to have an int of 33 bits,
have int_least32_t be that int, and then not provide int32_t.

But, I'd say that writing this information in the man would only confuse
readers, would not be helpful because those are actually unicorns.

The few programmers that may need that info might better go to the standard.

> Also, on all glibc platforms, int_leastN_t is equivalent to intN_t; this
> should probably be mentioned.

We deliberately decided to not give any information on this.
Unless there's a strict requirement by the standard,
or there's some very good reason for it,
the programmer should treat typedefs as what they actaully are:
opaque types with some width, signedness and other requirements,
which we document here.

>
> Similarly for int_fastN_t.

Same as above.

Thanks,

Alex