Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site byucsb.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!hpda!fortune!amd!decwrl!decvax!harpo!utah-cs!beesvax!byucsa!byucsc!byucsb!howard From: howard@byucsb.UUCP (Johnson Howard Reed) Newsgroups: net.lang.c Subject: Re: forward declared structures Message-ID: <136@byucsb.UUCP> Date: Mon, 6-Aug-84 04:14:30 EDT Article-I.D.: byucsb.136 Posted: Mon Aug 6 04:14:30 1984 Date-Received: Thu, 9-Aug-84 03:50:53 EDT References: <226@siemens.UUCP> <884@bbncca.ARPA>, <353@utmbvax.UUCP> Organization: U.C. Berkeley Lines: 12 The problem with: struct foo { struct bar *b; }; struct bar { struct foo *f; }; is that it allows a procedure to appear between them (at the global level). If this is rewritten as: struct foo { struct bar { struct foo *f; } *b; }; then any "forward reference" refers to a partially-declared struct/union and makes it easier for the compiler to detect such typos as: struct foo { struct bar { struct foo f; } *b; }; Howard Johnson harpo!utah-cs!beesvax!byucsa!byucsb!howard