Mail Archives: djgpp/2002/06/28/06:15:56
AYeryomin AT excelsior-usa DOT com (Alex Yeryomin) wrote in
<96eb2770 DOT 0206270530 DOT 3d2253dc AT posting DOT google DOT com>:
Hello
I don't know exactly why you want to align but if the reason is to read
from a file with a specified layout, I recommend to read into a character
buffer and then fetch each variable in turn. In that way, it's easier to
swap endianess and so on.
/ Niklas
>Hello,
>
>I can't find in FAQ (sorry, maybe I missed it), how to align struct
>members under gcc/DJGPP? What is pragma/option doing this? Is there
>some way to specify the alignment only for some piece of code like
>this:
>
><- set alignment by 1 byte here to pack all members altogether. how?
>struct zzz
>{
>...
>};
><- reset alignment to default. how?
>
>
>Is it possible to align also data object (variables) into the memory?
>F.e., all variables should be alignment by the paragraph 16 bytes.
>How?
>
>Best regards,
>
>Alex
- Raw text -