Ah sigh, do not make me weird; now i had to look. Well yes i also
use that idiom, but then without any array field in the struct as
such (ie alloc as much as needed, place the struct at the bottom
and then ptr=&type to point to thereafter).
The "data" field forces alignment constraints on the 'flexible' array at the end of the structure. If you leave it off and use
"&type" the pointer generated may actually not be correctly aligned for the type of 'data'.
You may not notice on a PC or an advanced ARM processor, but not all embedded CPUs can do misaligned accesses,
and they can be slower. You're definitely in undefined territory doing that.