Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lakesys!chad From: chad@lakesys.UUCP (Chad Gibbons) Newsgroups: comp.lang.c Subject: Re: Structure padding Message-ID: <518@lakesys.UUCP> Date: 6 Apr 89 18:13:22 GMT References: <440@front.se> Reply-To: chad@lakesys.UUCP (Chad Gibbons) Organization: Lake Systems - Milwaukee, Wisconsin Lines: 18 In article <440@front.se> zap@front.se (Svante Lindahl) writes: |Consider a struct consisting of a few character arrays, for example: | stuct foo { | char bar[3]; | char baz[6]; | char frotz[4]; | } fred; |I need to know if I can safely assume that there will not be any |padding between the arrays. I don't think so. I know for sure that Intel machines do place padding in appropriate areas in order to force alignment on even word addresses. I believe that Microsoft compilers have an option to eliminate this, but that slows down the program. I had a list of machines that require objects to start on even word addresses, but I can't find it....anyone? anyone? -- D. Chadwick Gibbons, chad@lakesys.lakesys.com, ...!uunet!marque!lakesys!chad