I have the following kind of code:
typedef struct
{
u32 count;
u16 list[];
} message_t;
...
message_t* msg = (message_t*)buffer;
msg->co
Your example do work since C has not arrays that dynamically become bigger when you add elements. So size of *msg is sizeof u32 + paddings, if any, but it won't count for list member, which you have to consider by yourself when you "alloc" the buffer and when you want to know the actual size of that "object", as you did.