Well I think this makes the code very bloated, and if it is truly UB then we should instead find a way to use 0-sized arrays in a portable way.
I believe 0 sized array for the last struct member is standard C99, so is there any compiler not supporting it yet (or some variation of it like with empty size)?
yes the so called "flexible array member" is c99 and seems to be supported by gcc, clang, msvc
but they don't seem to be accepted directly into wine (for now) (for example include/winnt.h see https://source.winehq.org/source/include/winnt.h#5815)
(there are a few others instances in the same way)
there are a couple of 0-length array instances (mosts of them protected by #ifdef _GNUC and fallback with 1 length array)
(and wine/msvcpdb.h uses them directly w/o fallbacks...)
I did a previous attempt with 0 length array for this but it never landed (https://www.winehq.org/pipermail/wine-devel/2022-February/207793.html)
so I'd wait for Alexandre's guidance on this
A+