Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!ukc!pyrltd!bejc From: bejc@pyrltd.UUCP (Brian Clark) Newsgroups: comp.windows.x,comp.sys.pyramid Subject: Re: Porting X windows to Pyramid Message-ID: <875@pyrltd.UUCP> Date: Fri, 14-Aug-87 04:08:43 EDT Article-I.D.: pyrltd.875 Posted: Fri Aug 14 04:08:43 1987 Date-Received: Sun, 16-Aug-87 09:49:09 EDT References: <4819@pyramid.pyramid.com> Reply-To: bejc@pyrltd.UUCP (Brian Clark) Organization: Pyramid Technology Ltd, Camberley, Surrey, UK. +44 276 63474 Lines: 28 Keywords: Pyramid Structure Alignment Xref: mnetor comp.windows.x:1267 comp.sys.pyramid:47 Summary: Expires: Sender: Followup-To: Distribution: To followup on the recent messages about structure alignment on the Pyramid. As has been noted all structures are aligned to a four byte boundary and are padded out to 32 bits. Where code is used of the form : j= sizeof(structure); then use of the value returned in j can give unexpected results. One way around this is to always give the exact value for j. The second way that has been suggested is to use the "-q" option to the C compiler. This enforces a more Vax-like packing of structures and functions such as "sizeof" will return the correct value. The first trade-off in using this option is a loss in performance - word aligned structures are far easier and quicker to fetch. The second trade-off is that none of the standard libraries have been compiled with the "-q" options and so calls that pass structures are potentially going to fail. It is necessary to remake the whole system with the different libraries and from that point on use only the "-q" option. This path has been taken, and has worked successfully at a Pyramid site in the UK, where a huge amount of code had to be ported. If only a single program or set of programs is involved it is perhaps worth taking the time to convert those parts where the structure boundary/size is giving problems. -- -m------- Brian E.J. Clark Phone : +44 276 63474 ---mmm----- Pyramid Technology Ltd Fax : +44 276 685189 -----mmmmm--- Telex : 859056 PYRUK G -------mmmmmmm- UUCP : !pyrltd!bejc