If you were design the worst possible file format, one which maximizes the number of bugs in its parsers, what features would it include?
Let me start:
Length-prefixed everything. Containers (lists, dicts, etc) have a length field in bytes, but all the items inside them also have their own length fields.
Structures' memory dump.
@Shamar boring / too obvious. Also, makes it impossible to add any other nasty features.
Actually it's very easy to add pointers. Consider what you can do with function pointers in a struct, for example.
Well... but you are not considering union fields and flexible arrays!
With flexible arrays, for example, you actually need to know the size of the message.
Under certain conditions this doesn't means a size field: for example you could use the file size to compute the size of the array (obviously, if it's not encrypted somehow).
But over the wire, this is a great way to build very funny parsers. 😉