Mail Archives: djgpp/2003/07/09/22:39:00
Hi
I want to know if it is possible to tell the compiler not to place
any padding in data structures to allign the data on word or dword.
For example, if I make a sizeof of the struct bellow, I will
obtain a size of 4 bytes instead of 3 bytes :
typedef unsigned char byte;
typedef unsigned short word;
typedef struc s_test_struct
{
byte var1;
word var2;
}s_test_struct;
sizeof ( s_test_struct ) is 4.
In this case, it add a byte of padding between the 2 variables to
make sure var2 is word aligned.
If there an option in DJGPP that can allow the compiler to ingnore
the data alignment and the padding process. Or is is possible to specify
somehow that the struct s_test_struct should not receive any padding.
Thank you for considering my request
Sayonara (^_^)
The Shadow
- Raw text -