check endianness linux in c code example Example: c detect endianness #define IS_LITTLE_ENDIAN (*(unsigned char *)&(uint32_t){1})