From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,8aa51189d42a66a4 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-11-08 08:28:02 PST Newsgroups: comp.sys.dec Path: gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!noc.near.net!atria.com!jtk From: jtk@atria.com (John T. Kohl) Subject: Re: HELP!! : Unaligned access error on DEC Alpha, $OS == osf1 In-Reply-To: jacobj@research.CS.ORST.EDU's message of 8 Nov 93 12:50:10 GMT Message-ID: Sender: news@atria.com Nntp-Posting-Host: 192.88.237.83 Organization: Atria Software, Inc. References: <2blfa2INN4sq@flop.ENGR.ORST.EDU> Date: Mon, 8 Nov 1993 15:32:32 GMT In article <2blfa2INN4sq@flop.ENGR.ORST.EDU> jacobj@research.CS.ORST.EDU (Joseph Jacob) writes: > when we try to run the program. > we found that it is coming at the following lines of code > temp = (struct NODE *)( mem_space+1); > temp->next= (struct NODE *)NULL ; > ... > where temp is defined as struct NODE *temp; > struct NODE { > struct NODE *next ; > ... > mem_space is defined as > int *mem_space ; Yep, that'll do it. If mem_space is an integer pointer, as you indicated, it will be aligned on a 4-byte boundary. Pointers must be aligned on 8-byte boundaries to avoid unaligned access problems. It's likely that mem_space itself is 8-byte aligned, so that mem_space+1 is only 4-byte aligned, hence the problems you see. -- John Kohl or working for but not representing: Atria Software --------- What are you pretending not to know?