Why is alignof(max_align_t) 16?

690 Views Asked by At

I'm running Debian on an x86_64 Intel processor.

gcc (Debian 8.3.0) compiles the following program

#include <stdio.h>
#include <stdalign.h>
#include <stddef.h>

int main(){
  printf("%zd\n",alignof(max_align_t));
}

and outputs

16

What datatype requires a 16 byte alignment?

1

There are 1 best solutions below

2
On BEST ANSWER

On x86_64, _Alignof(long double)==16.