| Issue |
243361
|
| Summary |
[X86] GCC and clang disagree on the classification of zero-length arrays and flexible array members
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
phoebewang
|
The x86 psABI does not say how a zero-length array
```c
struct S4 { float x; int a[0]; };
struct S4 f4(float v) { return (struct S4){ v }; }
```
or a flexible array member
```c
struct S5 { float x; int a[]; };
struct S5 f5(float v) { return (struct S5){ v }; }
```
affects the classification of the enclosing aggregate. And GCC and clang classify these differently: https://godbolt.org/z/rYsq6cxxK
There's a discusstion about how to unify it in the psABI: https://groups.google.com/g/x86-64-abi/c/86FOtzj9ZvI/m/T0ao3a0DAgAJ?pli=1
Post it to see any feedbacks.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs