[clang] [Clang][Sema] Allow flexible arrays in unions and alone in structs (PR #84428)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 05:06:18 PDT 2024


AaronBallman wrote:

> LGTM
> 
> The one thing I'm worried about here is the possibility that a future C standard version standardizes a similar extension, but with different semantics (since we're not using any reserved keywords here). Like I mentioned before, that's very unlikely to happen for non-zero-size unions, but zero-size types are a completely unexplored space in the standard.
> 
> But I guess if that happens, we can come with some sort of transition plan using attributes. And I don't have any specific idea of what the standards committee might choose to do differently, so maybe it's not that likely.

WG14 tries pretty hard to standardize existing practice when possible (we don't like breaking existing user code), so if we find ourselves in this position. I think the committee would be receptive to feedback that helps obviate or ease such a transition.

https://github.com/llvm/llvm-project/pull/84428


More information about the cfe-commits mailing list