C++ Logo


Advanced search

Re: [ub] [c++std-ext-14555] Sized integer types and char bits

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Fri, 18 Oct 2013 20:37:09 +0000
| -----Original Message-----
| From: ub-bounces_at_[hidden] [mailto:ub-bounces_at_[hidden]] On Behalf Of
| Stephan T. Lavavej
| Sent: Friday, October 18, 2013 12:06 PM
| To: c++std-ext_at_[hidden]; Herb Sutter
| Cc: WG21 UB study group
| Subject: Re: [ub] [c++std-ext-14555] Sized integer types and char bits
| [Gabriel Dos Reis, c++std-ext-14555]
| > My understanding of 'optional' is that the types are conditionally
| > supported, and a macro in <stdint.h> indicates whether the corresponding
| > type is supported.
| They are a special form of conditionally supported. C99 "Exact-width
| integer types" /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."

Furthermore, <stdint.h> is required to define INTN_MIN and INTN_MAX
macros for the limits of the corresponding intN_t datatype. A program can
test for these macros. Similar things for printf format specifiers in <inttypes.h>

-- Gaby

Received on 2013-10-18 22:37:30