nickdesaulniers wrote:

But then we (and GCC and MSVC) support the `[0]` extension syntax. So it's not 
like codegen is impossible.

https://godbolt.org/z/PGa9KWGxq

```c
union foo {
        int a;
        int b[]; // error: flexible array member 'b' in a union is not allowed
};
union bar {
        int a;
        int b[0]; // works just fine!
};
```

So to me, it seems like the standard can be amended to add the "or unions too" 
and already 3 implementations could generate valid code (GCC and clang would 
both need their semantic analyses relaxed here, but their codegen seems to work 
for the `[0]` extension already).

https://github.com/llvm/llvm-project/pull/84428
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to