Comment Comment by Animats > "buffer overflow within a struct" is often considered a feature.That's lying to the compiler, because there's no way to say what you meant.That's why I proposed the syntax typedef struct msgitem { const size_t len; char itemvalue[len]; }; struct msgitem firstmsg = { 100, 0 }; // empty msgitem, size 100 The last item of a struct could be a variable sized array. That's sound, and enough for things such as network packets. It's important to avoid bikeshedding. parent Animats 3 years ago
That's lying to the compiler, because there's no way to say what you meant.
That's why I proposed the syntax
The last item of a struct could be a variable sized array. That's sound, and enough for things such as network packets. It's important to avoid bikeshedding.