TL DR
1, 3, 4 C99, C11, intN_t . 2 C11, int8_t, int8_t , CHAR_BIT 8. 5, , C - undefined.
POSIX C, CHAR_BIT 8, - . C99/C11 POSIX int8_t, 1, 2, 3 4 true POSIX. POSIX , undefined, 5 .
C11 (C99). C11 7.20.1.1p1:
typedef intN_t N, . , int8_t 8 .
int8_t C, . C11 7.20.1.1p3:
. , 8, 16, 32 64 , ( ), , typedef.
, , . int INT_MIN INT_MAX . , INTN_MIN
.
. sizeof(intN_t) N / CHAR_BIT. POSIX , CHAR_BIT 8, sizeof(intN_t) N / 8
,
, 2 .
C, POSIX.
int8_t POSIX, C99, C11, POSIX . POSIX : *, CHAR_BIT 8 , C *, , C
C99, C11 , , intN_t 2 . int8_t, sizeof 1, signed char, CHAR_BIT 8.
intN_t, , , . :
int32_t *foo = malloc(sizeof(int32_t));
printf(PRId32 "\n", *foo);
printf(PRId32 "\n", *foo);
free(foo);
malloc; puts("42\n666"); - int32_t. , malloc:
[...] , , .
;
undefined.