The book The C Programming Language talks about \"the most restrictive type\" in section 8.7, Example — A Storage Allocator:
A
The most restrictive type is defined by max_align_t
, which is defined in stddef.h
. According to the standard:
A fundamental alignment is represented by an alignment less than or equal to the greatest alignment supported by the implementation in all contexts, which is equal to
_Alignof (max_align_t)
.
So max_align_t
has an alignment that is at least as large as that of every scalar type, and in most implementations its alignment will be equal to the largest scalar type - but this equality is not required by the standard.
The standard further requires (emphasis mine):
The order and contiguity of storage allocated by successive calls to the
aligned_alloc
,calloc
,malloc
, andrealloc
functions is unspecified. The pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to a pointer to any type of object with a fundamental alignment requirement and then used to access such an object or an array of such objects in the space allocated (until the space is explicitly deallocated).
So any pointer returned by allocation functions is aligned at least as strictly as the alignment of max_align_t
.