You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code is compiled into a size 8 array for a and size 1 array for b. Alignof is inconsistent, which i'd expect to be an error (or warning at least).
Here, gcc will warn the errors:
:4:17: error: expected primary-expression before 'struct'
4 | char a[_Alignof(struct S8)] = {0};
| ^~~~~~
:4:8: error: '_Alignof' was not declared in this scope
4 | char a[_Alignof(struct S8)] = {0};
| ^~~~~~~~
:5:17: error: expected primary-expression before 'struct'
5 | char b[_Alignof(struct S1)] = {0};
| ^~~~~~
:5:8: error: '_Alignof' was not declared in this scope
5 | char b[_Alignof(struct S1)] = {0};
| ^~~~~~~~
Compiler returned: 1
The text was updated successfully, but these errors were encountered:
The code is as follows:
`struct attribute ((aligned (8))) S8 { char a[8]; };
struct attribute ((packed)) S1 { struct S8 s8; };
char a[_Alignof(struct S8)] = {0};
char b[_Alignof(struct S1)] = {0};`
This code is compiled into a size 8 array for a and size 1 array for b. Alignof is inconsistent, which i'd expect to be an error (or warning at least).
Here, gcc will warn the errors:
The text was updated successfully, but these errors were encountered: