Open fuhsnn opened 10 months ago
This is a GCC extension; for arrays it reports alignment of the variable instead of the element type
#include <stdio.h> int main(int argc, char** argv) { char _Alignas(1024) arr1[11]; char _Alignas(1024) arr2[argc]; printf("%d\n", _Alignof arr1); // gcc/clang: 1024 chibicc: 1 printf("%d\n", _Alignof arr2); // gcc/clang: 1024 chibicc: 8 printf("%d\n", _Alignof *&arr1); // gcc:1024 clang:1 }
This is a GCC extension; for arrays it reports alignment of the variable instead of the element type