Xref: utzoo comp.arch:13296 comp.lang.c:25227 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!uunet!melpar!toppin From: toppin@melpar.UUCP (Doug Toppin X2075) Newsgroups: comp.arch,comp.lang.c Subject: RISC Machine Data Structure Word Alignment Problems? Keywords: risc sun Message-ID: <111@melpar.UUCP> Date: 19 Jan 90 23:46:21 GMT Organization: E-Systems, Falls Church, VA Lines: 28 We are using the SUN 4/260 which is a RISC architecture machine. We are having trouble with data alignment in our data structures. We have to communicate with external devices that require data structures such as the following: struct { long a; short b; long c; }; When we compile and link something referencing this structure the data produced appears to have had each element word boundary aligned so that what results appears to be as follows: struct { long a; short b; short pad; <==== this was inserted by cc to align next thing long c; }; This means that we lose the benefit of data abstraction and have to create our own output without using structures. We have not been able to find any Sun-4 cc option that eliminates this problem. We cannot use the 'compile as Sun-3' option. Please let us know if you know of a built-in way around this. thanks Doug Toppin uunet!melpar!toppin