Newsgroups: comp.os.msdos.djgpp Subject: Re: How to align members/data under gcc/DJGPP? From: Niklas_Pson AT nosmam DOT hotmail DOT com (Niklas Pettersson) References: <96eb2770 DOT 0206270530 DOT 3d2253dc AT posting DOT google DOT com> Message-ID: <923B78B1BNiklasPsonnospamhotm@195.67.237.51> User-Agent: Xnews/03.04.11 Lines: 36 Date: Fri, 28 Jun 2002 10:02:35 GMT NNTP-Posting-Host: 217.209.95.174 X-Complaints-To: abuse AT telia DOT com X-Trace: newsb.telia.net 1025258555 217.209.95.174 (Fri, 28 Jun 2002 12:02:35 CEST) NNTP-Posting-Date: Fri, 28 Jun 2002 12:02:35 CEST Organization: Telia Internet To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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