Talk:c/types/integer

std?
What is with the std:: on this C page? DeciusMagnus (talk) 21:20, 10 April 2023 (PDT)


 * Indeed... Reverted the edit that introduced the qualification ✅ --Ybab321 (talk) 02:24, 11 April 2023 (PDT)

No padding regardless of N?
For sizes other than 8, 16, 32, and 64, the description here currently says: "except that these may have padding bits." I don't think this is correct. From the C11 draft: 7.20.1.1 Exact-width integer types

1 The typedef name intN_t designates a signed integer type with width N, no padding bits, and a two's complement representation. Thus, int8_t denotes such a signed integer type with a width of exactly 8 bits.

2 The typedef name uintN_t designates an unsigned integer type with width N and no padding bits. Thus, uint24_t denotes such an unsigned integer type with a width of exactly 24 bits.

3 These types are optional. However, if an implementation provides integer types with widths of 8, 16, 32, or 64 bits, no padding bits, and (for the signed types) that have a two's complement representation, it shall define the corresponding typedef names

C99 draft was similar, except it forgot "no padding" on the unsigned types.

I read this as no padding regardless of N. The only special requirement is that if the implementation has the appropriate types for these sizes (8, 16, 32, 64), that the corresponding exact width types also exist. --Jzbiciak (talk) 01:49, 19 February 2021 (PST)
 * I agree, thanks (as far I can tell, this edit originated in applying C++ wording which summarized C wording a bit too tersely --Cubbi (talk) 10:51, 19 February 2021 (PST)