BorisTheOld wrote:I believe that any sort of auto-padding of structures is a bad idea.
Firstly, vendors of hardware and software all have their own ideas about this topic, so catering to one "standard" could create a nightmare for PB programmers.
Secondly, perhaps auto-padding is not appropriate for the situation. Having an undefined and undocumented field in a structure creates the potential for problems.
Thirdly, I believe that programmers should be more attuned to what's happening in their code. Therefore, they should be the ones adding any required padding to their structures. And they should document why they are doing it.
On x64 all WinAPI structures are aligned automaticly. Thats microsofts (VC++) standard. If you just copy a
structure from MSDN it can lead to crashes in PB, because PB does not
align the
structure members.
There may be some software that still dont allign
structure members, even if it's adviced to do so by Intel and AMD. (Variables should be aligned to a memory address dividable by the length of it's type. word = 2, long = 4, quad = 8 bytes)
To keep compatiblity with software interfaces that dont follow that rule there could be a keyword to create unaligned structures.