Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!gatech!emory!arnold From: arnold@emory.uucp (Arnold D. Robbins {EUCC}) Newsgroups: comp.lang.c Subject: Question on external struct declarations in ANSI C Message-ID: <2189@emory.uucp> Date: Mon, 3-Aug-87 14:42:43 EDT Article-I.D.: emory.2189 Posted: Mon Aug 3 14:42:43 1987 Date-Received: Tue, 4-Aug-87 04:17:41 EDT Organization: Math & Computer Science, Emory University, Atlanta Lines: 29 Keywords: extern, struct, ansi, gnu cc I recently put up the latest version of GNU CC (1.7) on my vaxen. Noticing that it produced really nice code, I decided that, *for fun*, I would try recompiling my kernel with it. (Let's NOT restart the whole "optimize my kernel" discussion; that's not what I am interested in.) 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. My question is, "is such a declaration illegal?". If so, could someone cite chapter and verse in the current ANSI draft standard? If such a declaration, *without* any subsequent use, is illegal, then an awful lot of existing code is going to break. On the other hand, if GNU CC is broken, then the GNU people need to be told about it. Thanks, -- Arnold Robbins ARPA, CSNET: arnold@emory.ARPA BITNET: arnold@emory UUCP: { decvax, gatech, sun!sunatl }!emory!arnold ONE-OF-THESE-DAYS: arnold@emory.mathcs.emory.edu