5.2.4.2.1 Sizes of integer types

Previous Table of Contents

300 The values given below shall be replaced by constant expressions suitable for use in #if preprocessing directives.

301 Moreover, except for CHAR_BIT and MB_LEN_MAX, the following shall be replaced by expressions that have the same type as would an expression that is an object of the corresponding type converted according to the integer promotions.

302 Their implementation-defined values shall be equal or greater in magnitude (absolute value) to those shown, with the same sign.

303 14) See “future language directions” (6.11.3).

304 —  number of bits for smallest object that is not a bit-field (byte)

CHAR_BIT 8

305 —  minimum value for an object of type signed char

SCHAR_MIN -127 // -(27-1)

306 —  maximum value for an object of type signed char

SCHAR_MAX +127 // 27-1

307 —  maximum value for an object of type unsigned char

UCHAR_MAX 255 // 28-1

308 —  minimum value for an object of type char

CHAR_MIN see below

309 —  maximum value for an object of type char

CHAR_MAX see below

310 —  maximum number of bytes in a multibyte character, for any supported locale

MB_LEN_MAX 1

311 —  minimum value for an object of type short int

SHRT_MIN -32767 // -(215-1)

312 —  maximum value for an object of type short int

SHRT_MAX +32767 // 215-1

313 —  maximum value for an object of type unsigned short int

USHRT_MAX 65535 // 216-1

314 —  minimum value for an object of type int

INT_MIN -32767 // -(215-1)

315 —  maximum value for an object of type int

INT_MAX +32767 // 215-1

316 —  maximum value for an object of type unsigned int

UINT_MAX 65535 // 216-1

317 —  minimum value for an object of type long int

LONG_MIN -2147483647 // -(231-1)

318 —  maximum value for an object of type long int

LONG_MAX +2147483647 // 231-1

319 —  maximum value for an object of type unsigned long int

ULONG_MAX 4294967295 // 232-1

320 —  minimum value for an object of type long long int

LLONG_MIN -9223372036854775807 // -(263-1)

321 —  maximum value for an object of type long long int

LLONG_MAX +9223372036854775807 // 263-1

322 —  maximum value for an object of type unsigned long long int

ULLONG_MAX 18446744073709551615 // 264-1

323 If the value of an object of type char is treated as a signed integer when used in an expression, the value of CHAR_MIN shall be the same as that of SCHAR_MIN and the value of CHAR_MAX shall be the same as that of SCHAR_MAX.

324 Otherwise, the value of CHAR_MIN shall be 0 and the value of CHAR_MAX shall be the same as that of UCHAR_MAX.15)

325 The value UCHAR_MAX shall equal 2CHAR_BIT-1.

326 Forward references: representations of types (6.2.6), conditional inclusion (6.10.1).

Next

Created at: 2005-06-29 02:18:53 The text from WG14/N1124 is copyright © ISO