int32_t, uint32_t uint8_t, , , , , (. C11 §6.3.1.3):
#include <stdint.h>
void foo(void)
{
uint8_t b0 = 0xef;
uint8_t b1 = 0xbe;
uint8_t b2 = 0xad;
uint8_t b3 = 0xde;
uint32_t ures = b0 | ((uint32_t)b1 << 8) |
((uint32_t)b2 << 16) | ((uint32_t)b3 << 24);
int32_t sres = (ures < (uint32_t)INT32_MIN) ?
(int32_t)ures : INT32_MIN + (int32_t)(ures & INT32_MAX);
}
, ( ).
EDIT: , (ures <= INT32_MAX) , (ures < (uint32_t)INT32_MIN) .