On Fri Mar 27 22:56:13 2026 +0000, Alfred Agrell wrote:
As far as I can tell, all compilers do, in fact, perform the obvious memory ops if given a struct with a trailing array. None of them deem it UB. https://godbolt.org/z/17hrvMrv4 If you're saying that's a missed-optimization bug and could change in future versions, I won't disagree, but then you're in https://gitlab.winehq.org/wine/wine/-/merge_requests/10471#note_134053 territory. This is more of a philosophical discussion, but I will still say that any program behavior is possible for such code -- including as in the specific case -- there are no guarantees of predictability and implementation requirements from the standard.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10471#note_134185