Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!orchid!rbutterworth From: rbutterworth@orchid.UUCP Newsgroups: comp.lang.c Subject: Re: Question on external struct declarations in ANSI C Message-ID: <10112@orchid.waterloo.edu> Date: Wed, 5-Aug-87 08:32:11 EDT Article-I.D.: orchid.10112 Posted: Wed Aug 5 08:32:11 1987 Date-Received: Fri, 7-Aug-87 05:41:18 EDT References: <1429@cullvax.UUCP> Organization: U of Waterloo, Ontario Lines: 17 In article <1429@cullvax.UUCP>, drw@cullvax.UUCP (Dale Worley) writes: > arnold@emory.uucp (Arnold D. Robbins {EUCC}) writes: > > extern struct pte Mbmap[]; /* page tables to map mbutl */ > Well, reading 3.5.2.2 and 3.5.3.2 of the draft suggests that this > module doesn't need to know the size of Mbmap at all (unless you > sizeof it or something), and so the size of struct pte doesn't need to > be known, and so struct pte need not be fully declared. Which of course implies that either 1) all structs must be aligned on a long double boundary, or 2) all sizeof(struct X*) pointers must be as big as (char *) pointers. On some machines (e.g. sizeof(char*) = 2*sizeof(int*), and alignof(long double) = 16), either choice can be fairly wasteful in terms of both space and cpu, all in the name of compatibility with old programs written by people too lazy to declare types when they could get away with it.