What is the default structure structure using cl / gcc / clang?

In msdn, for the cl / Zp compiler option, it is mentioned that "Batch structures on 8-byte boundaries (default)". Does this mean that if the data type is> 8 bytes in size, by default (without a compiler option or a pragma package), it will not be aligned naturally and rather will have 8-byte alignment. If so, is that the case with GCC / clang?

I checked GCC using -fpack-structand __uint128_tthat it does not have such a default value. For example, sizeof(tStruct)32 and 24 are equal:

struct tStruct {
uint64_t    a;
__uint128_t b;
};

I cannot check the same on windows as it does not provide a data type> 8 bytes.

+4
source share

All Articles