Path: utzoo!attcan!uunet!husc6!spdcc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Structure pointer question Message-ID: <4620@haddock.ISC.COM> Date: 19 Jun 88 19:16:50 GMT References: <361@teletron.uucp> <8074@brl-smoke.arpa> <4524@haddock.isc.com><4606@haddock.ISC.COM> <5925@aw Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 11 In article <5925@aw.sei.cmu.edu> firth@bd.sei.cmu.edu.UUCP (Robert Firth) writes: >Surely a pointer to a struct whose only component is of type X will use the >same representation as a pointer to a plain X. Nope. The fact that incomplete types are allowed in some circumstances (e.g. the existence of mutually recursive types) implies that all struct pointers have to smell the same. Thus, on word-addressible machines, struct{char} is word-aligned and padded. (Or else all structs use byte-pointers, but I don't believe I've heard of such implementations.) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint