From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,27231e56b1afd21f X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-12-07 22:52:35 PST Newsgroups: comp.unix.osf.osf1 Path: bga.com!news.sprintlink.net!howland.reston.ans.net!gatech!newsxfer.itd.umich.edu!caen!msunews!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!un!news From: al012@svtstu.seqeb.gov.au (Anthony) Subject: Re: Funny alignment with structures ? Message-ID: Sender: news@un.seqeb.gov.au (USENET News System) Organization: SEQEB X-Newsreader: WinVN 0.92.1 References: <3c1slb$qb3@newsstand.cit.cornell.edu> <3c2dij$268@nntpd2.cxo.dec.com> Date: Thu, 8 Dec 1994 01:31:19 GMT In article , al012@svtstu.seqeb.gov.au (Anthony) says: > >In article <3c2dij$268@nntpd2.cxo.dec.com>, alan@nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.) says: > >> >>You may be able to override some of the realignment enforced by >>the compiler, using compiler options (-Zp looks likely for the >>OSF C compiler). But the hardware still won't like it and you're >>likely to get unaligned access trap messages. You can fix this >>by realigning the data by hand if stuck with that particular data >>format, but it will use some program time to do it. >> > >Currently, I am using the -Zp1 switch to get my alignment. The >problem is that I am receiving a block of bits from a remote machine >and therefore I can't rearrange the order of the components of >my struct. I would have thought that a -Zp1 would cause the compiler >to generate code that would try and shift the bytes etc. ? Unfortunately, my -Zp1 switch seems to be causing my program to crashed :-(. Anthony Lee These are my opinions and not SEQEB. SEQEB 150 Charlotte Street Brisbane Qld 4000 Australia voice:+61 7 223 4541 fax: +61 7 221 7556 email: AL012@svtstu.seqeb.gov.au