tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: setsockopt() compat issue



Johnny Billquist wrote:

> Also, don't C99 actually mandate that [u]int{8|16|32|64}_t should be 
> defined.

C99 (WG14/N1256 Sep 2007 draft) says in 7.18.1.1:

  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 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 . Thus, uint24_t denotes 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.

and in 7.18.1.2:

  3 The following types are required:

         int_least8_t                        uint_least8_t
         int_least16_t                       uint_least16_t
         int_least32_t                       uint_least32_t
         int_least64_t                       uint_least64_t

    All other types of this form are optional.

So [u]int{8|16|32|64}_t should be defined if the hardware supports those
exact fixed width types, but they don't need to be if not available.

Cheers,
Simon.


Home | Main Index | Thread Index | Old Index