Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.arch Subject: Re: Sorting struct members for alignment (was Re: Unaligned Accesses) Keywords: alignment Message-ID: <3597@ficc.uu.net> Date: 28 Mar 89 23:04:57 GMT References: <37196@bbn.COM> <1989Mar16.190043.23227@utzoo.uucp> <11118@pur-ee.UUCP> Organization: Xenix Support Lines: 22 In article <11118@pur-ee.UUCP>, hankd@pur-ee.UUCP (Hank Dietz) writes: > In C, it has been a very common idiom to ASSUME that the address of the first > member of a struct IS the address of the struct. For example: > struct s { > char c; > double d; > } t; A very good point. A more common case is something like this: struct window_list { struct general_list wl_header; int wl_x0, wl_x1, wl_y0, wl_y1; struct damage_list wl_dlist; ... }; -- Peter da Silva, Xenix Support, Ferranti International Controls Corporation. Business: uunet.uu.net!ficc!peter, peter@ficc.uu.net, +1 713 274 5180. Personal: ...!texbell!sugar!peter, peter@sugar.hackercorp.com.