Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!ll-xn!husc6!necntc!cullvax!drw From: drw@cullvax.UUCP (Dale Worley) Newsgroups: comp.lang.c Subject: Question on external struct declarations in ANSI C Message-ID: <1429@cullvax.UUCP> Date: Tue, 4-Aug-87 10:52:16 EDT Article-I.D.: cullvax.1429 Posted: Tue Aug 4 10:52:16 1987 Date-Received: Thu, 6-Aug-87 01:53:37 EDT Organization: Cullinet Software, Westwood, MA, USA Lines: 22 arnold@emory.uucp (Arnold D. Robbins {EUCC}) writes: > Well, the kernel header files are full of declarations like > > extern struct pte Mbmap[]; /* page tables to map mbutl */ > > where, e.g., what a 'struct pte' is has not been previously defined. /bin/cc > lets you do this, and does not complain until you try to actually use one of > these things or a member of one. GNU CC, on the other hand, promptly dies > miserably when it sees such a declaration. GNU CC claims to follow the rules > of (a version of) the draft standard. 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. Dale -- Dale Worley Cullinet Software ARPA: cullvax!drw@eddie.mit.edu UUCP: ...!seismo!harvard!mit-eddie!cullvax!drw OS/2: Yesterday's software tomorrow