On Fri Mar 27 15:08:32 2026 +0000, Safocl Stollmannovic wrote:
(Also, fair chance it's UB per the C++ spec, but the compilers choose to implement it as doing the obvious memory operations.) As far as I can tell, no compiler guarantees normal access to memory outside an object through a pointer to its data subobject. 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. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10471#note_134175